Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Update Shell tool to 3.1.0
echo "Installation" curl "http://dist.neo4j.org/jexp/shell/neo4j-shell-tools_3.0.1.zip" -o neo4j-shell-tools.zip unzip neo4j-shell-tools.zip -d lib echo "Launch Shell-tool" ./bin/neo4j console sleep 5s ./bin/neo4j stop
echo "Installation" curl "http://dist.neo4j.org/jexp/shell/neo4j-shell-tools_3.1.0.zip" -o neo4j-shell-tools.zip unzip neo4j-shell-tools.zip -d lib echo "Launch Shell-tool" ./bin/neo4j console sleep 5s ./bin/neo4j stop
Debug mode for code coverage.
#!/bin/bash set -e # run tests on local if [ ! $APPVEYOR ]; then for path in test/*/*.csproj; do dotnet test $path done else # run tests on appveyor for path in test/*; do (cd $path; "..\\..\OpenCover\OpenCover.4.6.519\tools\OpenCover.Console.exe" \ -oldstyle \ -target:"C:\Program Files\dotnet\dotnet.exe" \ -filter:"+[Tossit.*]* -[*.Tests]* -[*]*.Api.*" \ -targetargs:"test" \ -mergeoutput -output:"..\\..\coverage.xml" -register:user) done fi
#!/bin/bash set -e # run tests on local if [ ! $APPVEYOR ]; then for path in test/*/*.csproj; do dotnet test $path done else # run tests on appveyor for path in test/*; do (cd $path; "..\\..\OpenCover\OpenCover.4.6.519\tools\OpenCover.Console.exe" \ -oldstyle \ -target:"C:\Program Files\dotnet\dotnet.exe" \ -filter:"+[Tossit.*]* -[*.Tests]* -[*]*.Api.*" \ -targetargs:"test -c Debug" \ -mergeoutput -output:"..\\..\coverage.xml" -register:user) done fi
Fix Firefox warning for content_security_policy
#!/bin/bash rm -rf dist mkdir -p dist/chrome dist/firefox cp -r css fonts img js LICENSE manifest.json *.html dist/chrome sed -i '' '/ "applications": {/,/ },/d' dist/chrome/manifest.json sed -i '' 's/ data-no-firefox//' dist/chrome/*.html pushd dist/chrome; zip -r ../chrome.zip *; popd cp -r css fonts img js LICENSE manifest.json *.html dist/firefox rm dist/firefox/js/ga.js sed -i '' '/"author"/d' dist/firefox/manifest.json sed -i '' '/"minimum_chrome_version"/d' dist/firefox/manifest.json sed -i '' 's/, "js\/ga.js"//' dist/firefox/manifest.json sed -i '' '/ data-no-firefox/d' dist/firefox/*.html pushd dist/firefox; zip -r ../firefox.xpi *; popd
#!/bin/bash rm -rf dist mkdir -p dist/chrome dist/firefox cp -r css fonts img js LICENSE manifest.json *.html dist/chrome sed -i '' '/ "applications": {/,/ },/d' dist/chrome/manifest.json sed -i '' 's/ data-no-firefox//' dist/chrome/*.html pushd dist/chrome; zip -r ../chrome.zip *; popd cp -r css fonts img js LICENSE manifest.json *.html dist/firefox rm dist/firefox/js/ga.js sed -i '' '/"author"/d' dist/firefox/manifest.json sed -i '' '/"minimum_chrome_version"/d' dist/firefox/manifest.json sed -i '' '/"content_security_policy"/d' dist/firefox/manifest.json sed -i '' 's/, "js\/ga.js"//' dist/firefox/manifest.json sed -i '' '/ data-no-firefox/d' dist/firefox/*.html pushd dist/firefox; zip -r ../firefox.xpi *; popd
Add "license.md" to the list of files Travis verifies
#!/usr/bin/env bash set -Eeuo pipefail cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." exitCode=0 for requiredFile in \ content.md \ github-repo \ maintainer.md \ ; do failed='' for repo in */; do case "${repo%/}" in scratch) continue ;; esac if [ ! -e "$repo/$requiredFile" ]; then failed+=" $repo" fi done if [ "$failed" ]; then echo >&2 "Missing $requiredFile for:$failed" exitCode=1 fi done exit "$exitCode"
#!/usr/bin/env bash set -Eeuo pipefail cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." exitCode=0 for requiredFile in \ content.md \ github-repo \ license.md \ maintainer.md \ ; do failed='' for repo in */; do case "${repo%/}" in scratch) continue ;; esac if [ ! -s "$repo/$requiredFile" ]; then failed+=" $repo" fi done if [ "$failed" ]; then echo >&2 "Missing $requiredFile for:$failed" exitCode=1 fi done exit "$exitCode"
Convert to a function only.
#!/bin/bash function solve() { deal_idx="$1" shift deal_fn="$deal_idx.all_in_a_row.board" sol_fn="$deal_idx.all_in_a_row.sol" make_pysol_freecell_board.py -t "$deal_idx" all_in_a_row > "$deal_fn" if all-in-a-row-solve "$deal_fn" > "$sol_fn" ; then perl verify_all_in_a_row.pl "$deal_fn" "$sol_fn" else echo "Unsolved"; fi } solve "$1"
function solve() { deal_idx="$1" shift deal_fn="$deal_idx.all_in_a_row.board" sol_fn="$deal_idx.all_in_a_row.sol" make_pysol_freecell_board.py -t "$deal_idx" all_in_a_row > "$deal_fn" if all-in-a-row-solve "$deal_fn" > "$sol_fn" ; then perl verify_all_in_a_row.pl "$deal_fn" "$sol_fn" else echo "Unsolved"; fi }
Check for root user run and exit the script, if the script is run as root user.
#!/bin/bash # Installing minimum of python 2.7 _python_version=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'` read -r -d "" _PYTHON_HELP <<EOF You are running an older version python ... \n \n Please run the following commands to setup python27 \n \n sudo yum update \n sudo yum install centos-release-scl \n sudo yum install python27 \n scl enable python27 bash \n EOF if [ "$_python_version" == "2.6.6" ] then echo -e $_PYTHON_HELP exit fi cd scripts/ sudo bash installessentials.sh sudo bash libgit2-build.sh bash osquery-build.sh sudo bash pip-install.sh sudo bash pyinstaller-hubble.sh pkg_clean sudo bash pyinstaller-hubble.sh pkg_init sudo bash pyinstaller-hubble.sh pkg_create
#!/bin/bash _user=`id -u` # Installing minimum of python 2.7 _python_version=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'` read -r -d "" _PYTHON_HELP <<EOF You are running an older version python ... \n \n Please run the following commands to setup python27 \n \n sudo yum update \n sudo yum install centos-release-scl \n sudo yum install python27 \n scl enable python27 bash \n EOF # Check if the python version is 2.6.6 if [ "$_python_version" == "2.6.6" ] then echo -e $_PYTHON_HELP exit fi # Check if the current user is root if [ "$_user" == "0" ] then echo "This script should not be run as root ..." echo "Please run this script as regular user with sudo privileges ..." echo "Exiting ..." exit fi cd scripts/ sudo bash installessentials.sh sudo bash libgit2-build.sh bash osquery-build.sh sudo bash pip-install.sh sudo bash pyinstaller-hubble.sh pkg_clean sudo bash pyinstaller-hubble.sh pkg_init sudo bash pyinstaller-hubble.sh pkg_create
Bring back -h option to ls variants
# Changing/making/removing directory setopt auto_pushd setopt pushd_ignore_dups setopt pushdminus alias -g ...='../..' alias -g ....='../../..' alias -g .....='../../../..' alias -g ......='../../../../..' alias 1='cd -' alias 2='cd -2' alias 3='cd -3' alias 4='cd -4' alias 5='cd -5' alias 6='cd -6' alias 7='cd -7' alias 8='cd -8' alias 9='cd -9' alias md='mkdir -p' alias rd=rmdir alias d='dirs -v | head -10' # List directory contents alias lsa='ls -lah' alias l='ls -la' alias ll='ls -l' alias la='ls -lA' # Push and pop directories on directory stack alias pu='pushd' alias po='popd'
# Changing/making/removing directory setopt auto_pushd setopt pushd_ignore_dups setopt pushdminus alias -g ...='../..' alias -g ....='../../..' alias -g .....='../../../..' alias -g ......='../../../../..' alias 1='cd -' alias 2='cd -2' alias 3='cd -3' alias 4='cd -4' alias 5='cd -5' alias 6='cd -6' alias 7='cd -7' alias 8='cd -8' alias 9='cd -9' alias md='mkdir -p' alias rd=rmdir alias d='dirs -v | head -10' # List directory contents alias lsa='ls -lah' alias l='ls -lah' alias ll='ls -lh' alias la='ls -lAh' # Push and pop directories on directory stack alias pu='pushd' alias po='popd'
Set environmental variable SEPAL to true in sandbox.
#!/bin/bash echo echo "******************************" echo "*** Setting up environment ***" echo "******************************" # Create ssh deamon folder mkdir /var/run/sshd # Setup /etc/environment printf '%s\n' \ 'PATH="usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/lib/orfeo/bin"' \ 'JAVA_HOME="/usr/lib/jvm/java-8-oracle"' \ 'GDAL_DATA="/usr/share/gdal/2.1"' \ >> /etc/environment # Remove redundant files rm -rf /var/lib/apt/lists/* rm -rf /tmp/* echo echo "*************************" echo "*** Image Initialized ***" echo "*************************"
#!/bin/bash echo echo "******************************" echo "*** Setting up environment ***" echo "******************************" # Create ssh deamon folder mkdir /var/run/sshd # Setup /etc/environment printf '%s\n' \ 'PATH="usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/lib/orfeo/bin"' \ 'JAVA_HOME="/usr/lib/jvm/java-8-oracle"' \ 'GDAL_DATA="/usr/share/gdal/2.1"' \ 'SEPAL="true"' \ >> /etc/environment # Remove redundant files rm -rf /var/lib/apt/lists/* rm -rf /tmp/* echo echo "*************************" echo "*** Image Initialized ***" echo "*************************"
Add debugging lines for upgrade ops man disk size
#!/usr/bin/env bash # Copyright 2017-Present Pivotal Software, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -eu function checkDiskSize() { local vm_disk_size="${1}" if [ $vm_disk_size = "" ] || [ $vm_disk_size = "null" ]; then vm_disk_size="$( cliaas-linux get-vm-disk-size -c cliaas-config/config.yml -i $VM_IDENTIFIER) " fi echo "$vm_disk_size" } cliaas-linux replace-vm \ --config cliaas-config/config.yml \ --identifier "$VM_IDENTIFIER" \ --disk-size-gb "$( checkDiskSize $VM_DISK_SIZE_GB )"
#!/usr/bin/env bash # Copyright 2017-Present Pivotal Software, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -eu function checkDiskSize() { local vm_disk_size="${1}" if [ $vm_disk_size = "" ] || [ $vm_disk_size = "null" ]; then vm_disk_size="$( cliaas-linux get-vm-disk-size -c cliaas-config/config.yml -i $VM_IDENTIFIER) " fi echo "$vm_disk_size" } diskSizeGB="$( checkDiskSize $VM_DISK_SIZE_GB )" echo "Setting disk size of vm $VM_IDENTIFIER to $diskSizeGB" cliaas-linux replace-vm \ --config cliaas-config/config.yml \ --identifier "$VM_IDENTIFIER" \ --disk-size-gb "$diskSizeGB"
Make sure to refresh the service too
# Copyright 2013, Joyent. Inc. All rights reserved. log "cleaning up" svccfg -s zoneinit 'setprop application/done = true' rm -f ${ZONECONFIG} log "scheduling an immediate reboot" echo "reboot >/dev/null" | at now >/dev/null
# Copyright 2013, Joyent. Inc. All rights reserved. log "cleaning up" svccfg -s zoneinit 'setprop application/done = true' svcadm refresh zoneinit rm -f ${ZONECONFIG} log "scheduling an immediate reboot" echo "reboot >/dev/null" | at now >/dev/null
Make gv (edit .vimrc, .gvimrc) alias cd to file location.
# Editing if [[ ! "$SSH_TTY" ]] && is_osx; then export EDITOR='mvim' export LESSEDIT='mvim ?lm+%lm -- %f' else export EDITOR='vim' fi export VISUAL="$EDITOR" alias q="$EDITOR" alias qv="q $DOTFILES/link/.{,g}vimrc" alias qs="q +'cd $DOTFILES'"
# Editing if [[ ! "$SSH_TTY" ]] && is_osx; then export EDITOR='mvim' export LESSEDIT='mvim ?lm+%lm -- %f' else export EDITOR='vim' fi export VISUAL="$EDITOR" alias q="$EDITOR" alias qv="q $DOTFILES/link/.{,g}vimrc +'cd $DOTFILES/link'" alias qs="q +'cd $DOTFILES'"
Check Hangul/Hanja key remapping before modifying.
#!/bin/bash # vim: syntax=sh # This is only for Ubuntu 14.04 on my own gram if [[ $(uname -n) = "gh4ck3r" && $(grep DISTRIB_RELEASE= /etc/lsb-release | cut -f2 -d'=') = "14.04" ]];then if which xmodmap > /dev/null 2>&1; then xmodmap -e 'keycode 108 = Hangul' xmodmap -e 'keycode 105 = Hangul_Hanja' xmodmap -e 'remove mod1 = Hangul' xmodmap -e 'remove control = Hangul_Hanja' else echo "xmodmap is not found --> Check hangul/hanja key remapping" fi if which gsettings > /dev/null 2>&1; then gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['Hangul']" else echo "gsetting is not found --> Check hangul key binding" fi fi
#!/bin/bash # vim: syntax=sh # This is only for Ubuntu 14.04 on my own gram if [[ $(uname -n) = "gh4ck3r" && $(grep DISTRIB_RELEASE= /etc/lsb-release | cut -f2 -d'=') = "14.04" ]];then if which xmodmap > /dev/null 2>&1; then xmodmap -e 'keycode 108 = Hangul' xmodmap -e 'keycode 105 = Hangul_Hanja' xmodmap -pm | while read mod_key rest; do case "$mod_key" in "mod1") [[ "$rest" = *Hangul* ]] && xmodmap -e 'remove mod1 = Hangul' ;; "control") [[ "$rest" = *Hangul_Hanja* ]] && xmodmap -e 'remove control = Hangul_Hanja' ;; *);; esac done else echo "xmodmap is not found --> Check hangul/hanja key remapping" fi if which gsettings > /dev/null 2>&1; then gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['Hangul']" else echo "gsetting is not found --> Check hangul key binding" fi fi
Add --force-yes tag to apt-get install command
#!/bin/bash set -e set -x add-apt-repository ppa:openjdk-r/ppa apt-get update apt-get install -y wget openjdk-7-jdk openjdk-8-jdk TOMCAT_7=7.0.61 TOMCAT_8=8.0.21 mkdir -p /opt/tomcat cd /opt/tomcat wget https://archive.apache.org/dist/tomcat/tomcat-7/v$TOMCAT_7/bin/apache-tomcat-$TOMCAT_7.tar.gz tar -xvzf apache-tomcat-$TOMCAT_7.tar.gz rm apache-tomcat-$TOMCAT_7.tar.gz mv apache-tomcat* $TOMCAT_7 wget https://archive.apache.org/dist/tomcat/tomcat-8/v$TOMCAT_8/bin/apache-tomcat-$TOMCAT_8.tar.gz tar -xvzf apache-tomcat-$TOMCAT_8.tar.gz rm apache-tomcat-$TOMCAT_8.tar.gz mv apache-tomcat* $TOMCAT_8 # Set default to Java 8. echo 2 | update-alternatives --config java # Give the mop user read access. chmod -R a+r /opt/tomcat
#!/bin/bash set -e set -x add-apt-repository ppa:openjdk-r/ppa apt-get update apt-get install -y --force-yes wget openjdk-7-jdk openjdk-8-jdk TOMCAT_7=7.0.61 TOMCAT_8=8.0.21 mkdir -p /opt/tomcat cd /opt/tomcat wget https://archive.apache.org/dist/tomcat/tomcat-7/v$TOMCAT_7/bin/apache-tomcat-$TOMCAT_7.tar.gz tar -xvzf apache-tomcat-$TOMCAT_7.tar.gz rm apache-tomcat-$TOMCAT_7.tar.gz mv apache-tomcat* $TOMCAT_7 wget https://archive.apache.org/dist/tomcat/tomcat-8/v$TOMCAT_8/bin/apache-tomcat-$TOMCAT_8.tar.gz tar -xvzf apache-tomcat-$TOMCAT_8.tar.gz rm apache-tomcat-$TOMCAT_8.tar.gz mv apache-tomcat* $TOMCAT_8 # Set default to Java 8. echo 2 | update-alternatives --config java # Give the mop user read access. chmod -R a+r /opt/tomcat
Remove max-requests in gunicorn to avoid breaking deploy when auto restart
#!/bin/bash # specify the client id, client secret and sso server here source ./config export SSO_CLIENT_ID=$client_id export SSO_CLIENT_SECRET=$client_sec export SSO_REDIRECT_URI=$redirect_uri export CONSOLE_API_SCHEME=$console_api_scheme export CONSOLE_LOG_LEVEL=${debug:-"INFO"} export CONSOLE_APISERVER="http://deployd.lain:9003" export CONSOLE_DB_HOST=$mysql_host export CONSOLE_DB_NAME=$mysql_dbname export CONSOLE_DB_PORT=$mysql_port export CONSOLE_DB_USER=$mysql_user export CONSOLE_DB_PASSWORD=$mysql_passwd export CONSOLE_SENTRY_DSN=$console_sentry_dsn mkdir -p /lain/logs exec gunicorn -w 3 -b 0.0.0.0:8000 --max-requests=100 --preload --error-logfile /lain/logs/error.log --access-logfile /lain/logs/access.log console.wsgi
#!/bin/bash # specify the client id, client secret and sso server here source ./config export SSO_CLIENT_ID=$client_id export SSO_CLIENT_SECRET=$client_sec export SSO_REDIRECT_URI=$redirect_uri export CONSOLE_API_SCHEME=$console_api_scheme export CONSOLE_LOG_LEVEL=${debug:-"INFO"} export CONSOLE_APISERVER="http://deployd.lain:9003" export CONSOLE_DB_HOST=$mysql_host export CONSOLE_DB_NAME=$mysql_dbname export CONSOLE_DB_PORT=$mysql_port export CONSOLE_DB_USER=$mysql_user export CONSOLE_DB_PASSWORD=$mysql_passwd export CONSOLE_SENTRY_DSN=$console_sentry_dsn mkdir -p /lain/logs exec gunicorn -w 3 -b 0.0.0.0:8000 --preload --error-logfile /lain/logs/error.log --access-logfile /lain/logs/access.log console.wsgi
Read $DBHOST directly within the test application.
#!/bin/bash fw_depends dlang dub sed -i 's|127.0.0.1|'"${DBHOST}"'|g' source/app.d # Clean any files from last run rm -f fwb rm -rf .dub dub build --force ./fwb &
#!/bin/bash fw_depends dlang dub # Clean any files from last run rm -f fwb rm -rf .dub dub build ./fwb &
Update JAVA_HOME to Java 1.8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/
Upgrade cppcheck and disable inconclusive checks
#!/bin/bash pushd .. wget http://sourceforge.net/projects/cppcheck/files/cppcheck/1.64/cppcheck-1.64.tar.bz2 tar -xvf cppcheck-1.64.tar.bz2 cd cppcheck-1.64 make -j2 popd ../cppcheck-1.64/cppcheck --enable=all --inconclusive -I include --inline-suppr --std=c++11 --platform=unix64 src/main.cpp src/chai*.cpp --template ' - __{severity}__: [{file}:{line}](../blob/TRAVIS_COMMIT/{file}#L{line}) {message} ({id})' 2>output sed -i "s/TRAVIS_COMMIT/${TRAVIS_COMMIT}/g" output echo -n '{ "body": " ' > output.json echo -n `awk '{printf "%s\\\\n", $0;}' output` >> output.json echo -n '"}' >> output.json if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl -H "Authorization: token ${TOKEN}" --request POST --data @output.json https://api.github.com/repos/ChaiScript/ChaiScript/commits/${TRAVIS_COMMIT}/comments; else curl -H "Authorization: token ${TOKEN}" --request POST --data @output.json https://api.github.com/repos/ChaiScript/ChaiScript/issues/${TRAVIS_PULL_REQUEST}/comments; fi
#!/bin/bash pushd .. wget http://sourceforge.net/projects/cppcheck/files/cppcheck/1.64/cppcheck-1.65.tar.bz2 tar -xvf cppcheck-1.65.tar.bz2 cd cppcheck-1.65 make -j2 popd ../cppcheck-1.65/cppcheck --enable=all -I include --inline-suppr --std=c++11 --platform=unix64 src/main.cpp src/chai*.cpp --template ' - __{severity}__: [{file}:{line}](../blob/TRAVIS_COMMIT/{file}#L{line}) {message} ({id})' 2>output sed -i "s/TRAVIS_COMMIT/${TRAVIS_COMMIT}/g" output echo -n '{ "body": " ' > output.json echo -n `awk '{printf "%s\\\\n", $0;}' output` >> output.json echo -n '"}' >> output.json if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl -H "Authorization: token ${TOKEN}" --request POST --data @output.json https://api.github.com/repos/ChaiScript/ChaiScript/commits/${TRAVIS_COMMIT}/comments; else curl -H "Authorization: token ${TOKEN}" --request POST --data @output.json https://api.github.com/repos/ChaiScript/ChaiScript/issues/${TRAVIS_PULL_REQUEST}/comments; fi
Add the --no-include-email to our 'aws ecr get-login' call
#!/usr/bin/env bash # Push a Docker image to ECR and copy its release ID to our S3 bucket. set -o errexit set -o nounset $(aws ecr get-login) docker push "$TAG" echo "New container image is $RELEASE_ID" echo "$RELEASE_ID" | aws s3 cp - "s3://$CONFIG_BUCKET/releases/$PROJECT" exit 0
#!/usr/bin/env bash # Push a Docker image to ECR and copy its release ID to our S3 bucket. set -o errexit set -o nounset $(aws ecr get-login --no-include-email) docker push "$TAG" echo "New container image is $RELEASE_ID" echo "$RELEASE_ID" | aws s3 cp - "s3://$CONFIG_BUCKET/releases/$PROJECT" exit 0
Save the exit code of the tests and pass it to parent.
#!/bin/bash # Start the testing. # Get script directory. TEST="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT="$TEST/.." # Start selenium server in the background and record its PID. java -jar "$TEST/selenium.jar" -Dphantomjs.binary.path="$ROOT/node_modules/.bin/phantomjs" > /dev/null 2>&1 & # Start the node server in the background and record its PID. node "$TEST/server.js" > /dev/null 2>&1 & printf "\nWaiting for servers to start..." while true; do if ! curl --output /dev/null --silent --head --fail http://localhost:4444/wd/hub || ! curl --output /dev/null --silent --head --fail http://localhost:4000; then sleep 1; printf "." else printf "Done\n" break fi done printf "\nRunning tests with WebDriver...\n" "$ROOT/node_modules/.bin/wdio" "$TEST/wdio.conf.js" printf "\nKilling background processes..." kill $(jobs -rp) && wait $(jobs -rp) > /dev/null 2>&1 printf "Done\n"
#!/bin/bash # Start the testing. # Get script directory. TEST="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT="$TEST/.." # Start selenium server in the background and record its PID. java -jar "$TEST/selenium.jar" -Dphantomjs.binary.path="$ROOT/node_modules/.bin/phantomjs" > /dev/null 2>&1 & # Start the node server in the background and record its PID. node "$TEST/server.js" > /dev/null 2>&1 & printf "\nWaiting for servers to start..." while true; do if ! curl --output /dev/null --silent --head --fail http://localhost:4444/wd/hub || ! curl --output /dev/null --silent --head --fail http://localhost:4000; then sleep 1; printf "." else printf "Done\n" break fi done printf "\nRunning tests with WebDriver...\n" "$ROOT/node_modules/.bin/wdio" "$TEST/wdio.conf.js" RESULT=$? printf "\nKilling background processes..." kill $(jobs -rp) && wait $(jobs -rp) > /dev/null 2>&1 printf "Done\n" exit $RESULT
Use nvidia docker instead of normal docker.
#!/bin/bash sudo docker run -ti --device /dev/nvidia0:/dev/nvidia0 --device \ /dev/nvidiactl:/dev/nvidiactl --device /dev/nvidia-uvm:/dev/nvidia-uvm \ -v "$(dirname "`pwd`")":/home/theano/research --net=host djpetti/rpinets-theano /bin/bash
#!/bin/bash sudo nvidia-docker run -ti -v "$(dirname "`pwd`")":/home/theano/research --net=host djpetti/rpinets-theano /bin/bash
Move web version to 0.0.2
#!/bin/bash webTag="${WEB_TAG:-0.0.1}" here=$(python -c 'import os; print os.path.realpath(os.getcwd())') webDir=${here}/web test -d ${webDir} || git clone https://github.com/keydotcat/web.git ${webDir} ( cd ${webDir} git fetch [ $(git describe --abbrev=8 --dirty --always --tags) == "${webTag}" ] || git checkout ${webTag} -b auto-${webTag} echo 'Set web version to' ${webTag} yarn install yarn run build:web ) ln -sf ${webDir}/dist/web ${here}/data/web
#!/bin/bash webTag="${WEB_TAG:-0.0.2}" here=$(python -c 'import os; print os.path.realpath(os.getcwd())') webDir=${here}/web test -d ${webDir} || git clone https://github.com/keydotcat/web.git ${webDir} ( cd ${webDir} git fetch [ $(git describe --abbrev=8 --dirty --always --tags) == "${webTag}" ] || git checkout ${webTag} -b auto-${webTag} echo 'Set web version to' ${webTag} yarn install yarn run build:web ) ln -sf ${webDir}/dist/web ${here}/data/web
Add alias for syncing with mission control
# Sync my wp.com sandbox alias wpcom-sync='unison -ui text -repeat watch wpcom' alias pnpm='npx pnpm'
# Sync my wp.com sandbox alias wpcom-sync='unison -ui text -repeat watch wpcom' alias mc-sync='unison -ui text -repeat watch missioncontrol' alias pnpm='npx pnpm'
Make sure to delete old files
python input_to_database.py main python input_to_database.py maf --vcf2mafPath ~/vcf2maf-1.6.14 --vepPath ~/vep --vepData ~/.vep --createNewMafDatabas python input_to_database.py vcf --vcf2mafPath ~/vcf2maf-1.6.14 --vepPath ~/vep --vepData ~/.vep
python input_to_database.py main python input_to_database.py maf --vcf2mafPath ~/vcf2maf-1.6.14 --vepPath ~/vep --vepData ~/.vep --deleteOld --createNewMafDatabase python input_to_database.py vcf --vcf2mafPath ~/vcf2maf-1.6.14 --vepPath ~/vep --vepData ~/.vep --deleteOld
Add topkg to travis configuration
travis_install_on_linux () { sudo apt-get install liblapack-dev sudo apt-get install gfortran # for lbgfs sudo apt-get install libffi-dev # for Ctypes } travis_install_on_osx () { echo "brew install lapack" brew install homebrew/dupes/lapack > /dev/null echo "brew install gcc" brew install gcc > /dev/null # for gfortran echo "brew install libffi" brew install libffi > /dev/null # for ocephes echo "brew install finished!" } case $TRAVIS_OS_NAME in osx) travis_install_on_osx ;; linux) travis_install_on_linux ;; *) echo "Unknown $TRAVIS_OS_NAME"; exit 1 esac eval `opam config env` export OPAMYES="true" opam install ocamlbuild opam pin add dsfo git://github.com/rleonid/dsfo #echo Installing Libraries #make setup-test echo Compiling topkg build topkg build -n omltest echo Testing topkg test #echo PostingCoverage #opam install ocveralls #cd _test_build #ocveralls --repo_token $COVERALLSTOKEN --git --send ../bisect0001.out
travis_install_on_linux () { sudo apt-get install liblapack-dev sudo apt-get install gfortran # for lbgfs sudo apt-get install libffi-dev # for Ctypes } travis_install_on_osx () { echo "brew install lapack" brew install homebrew/dupes/lapack > /dev/null echo "brew install gcc" brew install gcc > /dev/null # for gfortran echo "brew install libffi" brew install libffi > /dev/null # for ocephes echo "brew install finished!" } case $TRAVIS_OS_NAME in osx) travis_install_on_osx ;; linux) travis_install_on_linux ;; *) echo "Unknown $TRAVIS_OS_NAME"; exit 1 esac eval `opam config env` export OPAMYES="true" opam install ocamlfind topkg ocamlbuild opam pin add dsfo git://github.com/rleonid/dsfo #echo Installing Libraries #make setup-test echo Compiling topkg build topkg build -n omltest echo Testing topkg test #echo PostingCoverage #opam install ocveralls #cd _test_build #ocveralls --repo_token $COVERALLSTOKEN --git --send ../bisect0001.out
Use tap reporter for prove
#!/bin/sh MOCHA=./node_modules/grunt-mocha-test/node_modules/.bin/mocha $MOCHA --reporter spec --require './sandbox/loader' sandbox/mocha_node.js exit 0
#!/bin/sh MOCHA=./node_modules/grunt-mocha-test/node_modules/.bin/mocha $MOCHA --reporter tap --require './sandbox/loader' sandbox/mocha_node.js exit 0
Use patched branch of ion
GIT=https://gitlab.redox-os.org/redox-os/ion.git
GIT=https://gitlab.redox-os.org/redox-os/ion.git BRANCH=redox-unix
Add --force to devtools upload
#!/bin/bash # Must be invoked with $PACKAGENAME echo $TRAVIS_PULL_REQUEST $TRAVIS_BRANCH PUSH_DOCS_TO_S3=false if [ "$TRAVIS_PULL_REQUEST" = true ]; then echo "This is a pull request. No deployment will be done."; exit 0 fi if [ "$TRAVIS_BRANCH" != "master" ]; then echo "No deployment on BRANCH='$TRAVIS_BRANCH'"; exit 0 fi # Deploy to binstar conda install --yes anaconda-client jinja2 pushd . cd $HOME/miniconda/conda-bld FILES=*/${PACKAGENAME}-dev-*.tar.bz2 for filename in $FILES; do anaconda -t $BINSTAR_TOKEN remove ${ORGNAME}/${PACKAGENAME}-dev/${filename} anaconda -t $BINSTAR_TOKEN upload -u ${ORGNAME} -p ${PACKAGENAME}-dev ${filename} done popd if [ $PUSH_DOCS_TO_S3 = true ]; then # Create the docs and push them to S3 # ----------------------------------- conda install --yes pip conda config --add channels $ORGNAME conda install --yes `conda build devtools/conda-recipe --output` pip install numpydoc s3cmd msmb_theme conda install --yes `cat docs/requirements.txt | xargs` conda list -e (cd docs && make html && cd -) ls -lt docs/_build pwd python devtools/ci/push-docs-to-s3.py fi
#!/bin/bash # Must be invoked with $PACKAGENAME echo $TRAVIS_PULL_REQUEST $TRAVIS_BRANCH PUSH_DOCS_TO_S3=false if [ "$TRAVIS_PULL_REQUEST" = true ]; then echo "This is a pull request. No deployment will be done."; exit 0 fi if [ "$TRAVIS_BRANCH" != "master" ]; then echo "No deployment on BRANCH='$TRAVIS_BRANCH'"; exit 0 fi # Deploy to binstar conda install --yes anaconda-client jinja2 pushd . cd $HOME/miniconda/conda-bld FILES=*/${PACKAGENAME}-dev-*.tar.bz2 for filename in $FILES; do anaconda -t $BINSTAR_TOKEN remove ${ORGNAME}/${PACKAGENAME}-dev/${filename} anaconda -t $BINSTAR_TOKEN upload --force -u ${ORGNAME} -p ${PACKAGENAME}-dev ${filename} done popd if [ $PUSH_DOCS_TO_S3 = true ]; then # Create the docs and push them to S3 # ----------------------------------- conda install --yes pip conda config --add channels $ORGNAME conda install --yes `conda build devtools/conda-recipe --output` pip install numpydoc s3cmd msmb_theme conda install --yes `cat docs/requirements.txt | xargs` conda list -e (cd docs && make html && cd -) ls -lt docs/_build pwd python devtools/ci/push-docs-to-s3.py fi
Remove the avahi-daemon pid file too
#!/bin/bash sed -i "s/rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf cd /root/.homebridge file="/root/.homebridge/package.json" if [ -f "$file" ] then echo "$file found. Going to install additional plugins." npm run install else echo "$file not found. You can create this file to install additional plugins not already included in the docker image." fi rm /var/run/dbus/pid dbus-daemon --system avahi-daemon -D homebridge
#!/bin/bash sed -i "s/rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf cd /root/.homebridge file="/root/.homebridge/package.json" if [ -f "$file" ] then echo "$file found. Going to install additional plugins." npm run install else echo "$file not found. You can create this file to install additional plugins not already included in the docker image." fi rm -f /var/run/dbus/pid /var/run/avahi-daemon/pid dbus-daemon --system avahi-daemon -D homebridge
Add redirect to actual binary on S3.
#!/usr/bin/env bash # This file uses `bash` and not `sh` due to the `time` builtin (the external # `time` is not available on CircleCI). set -eu BUCKET_NAME="cockroach" LATEST_SUFFIX=".LATEST" REPO_NAME="cockroach" # $0 takes the path to the binary inside the repo. # eg: $0 sql/sql.test sql/sql-foo.test # The file will be pushed to: s3://BUCKET_NAME/REPO_NAME/sql-foo.test.SHA # The S3 basename will be stored in s3://BUCKET_NAME/REPO_NAME/sql-foo.test.LATEST sha=$1 rel_path=$2 binary_name=${3-$(basename "${2}")} cd "$(dirname "${0}")/.." time aws s3 cp ${rel_path} s3://${BUCKET_NAME}/${REPO_NAME}/${binary_name}.${sha} # Upload LATEST file. tmpfile=$(mktemp /tmp/cockroach-push.XXXXXX) echo ${sha} > ${tmpfile} time aws s3 cp ${tmpfile} s3://${BUCKET_NAME}/${REPO_NAME}/${binary_name}${LATEST_SUFFIX} rm -f ${tmpfile}
#!/usr/bin/env bash # This file uses `bash` and not `sh` due to the `time` builtin (the external # `time` is not available on CircleCI). set -eu BUCKET_NAME="cockroach" LATEST_SUFFIX=".LATEST" REPO_NAME="cockroach" # $0 takes the path to the binary inside the repo. # eg: $0 sql/sql.test sql/sql-foo.test # The file will be pushed to: s3://BUCKET_NAME/REPO_NAME/sql-foo.test.SHA # The binary's sha will be stored in s3://BUCKET_NAME/REPO_NAME/sql-foo.test.LATEST # The .LATEST file will also redirect to the latest binary when fetching through # the S3 static-website. sha=$1 rel_path=$2 binary_name=${3-$(basename "${2}")} cd "$(dirname "${0}")/.." time aws s3 cp ${rel_path} s3://${BUCKET_NAME}/${REPO_NAME}/${binary_name}.${sha} # Upload LATEST file. tmpfile=$(mktemp /tmp/cockroach-push.XXXXXX) echo ${sha} > ${tmpfile} time aws s3 cp --website-redirect "/${REPO_NAME}/${binary_name}.${sha}" ${tmpfile} s3://${BUCKET_NAME}/${REPO_NAME}/${binary_name}${LATEST_SUFFIX} rm -f ${tmpfile}
Fix jump with space for bash too
if [[ -z $BOOKMARKS_FILE ]] ; then export BOOKMARKS_FILE="$HOME/.bookmarks" fi if [[ ! -f $BOOKMARKS_FILE ]]; then touch $BOOKMARKS_FILE fi function mark() { echo $1 : $(pwd) >> $BOOKMARKS_FILE } fzfcmd() { [ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" } function jump() { local jumpline=$(cat ${BOOKMARKS_FILE} | $(fzfcmd) --bind=ctrl-y:accept --tac) if [[ -n ${jumpline} ]]; then local jumpdir=$(echo $jumpline | awk '{print $3}' | sed "s#~#$HOME#") perl -p -i -e "s#${jumpline}\n##g" $BOOKMARKS_FILE cd ${jumpdir} && echo ${jumpline} >> $BOOKMARKS_FILE fi } function dmark() { local marks_to_delete=$(cat $BOOKMARKS_FILE | $(fzfcmd) -m --bind=ctrl-y:accept,ctrl-t:toggle-up --tac) while read -r line; do perl -p -i -e "s#${line}\n##g" $BOOKMARKS_FILE done <<< "$marks_to_delete" echo "** The following marks were deleted **" echo ${marks_to_delete} } bind '"\C-g":"jump\n"'
if [[ -z $BOOKMARKS_FILE ]] ; then export BOOKMARKS_FILE="$HOME/.bookmarks" fi if [[ ! -f $BOOKMARKS_FILE ]]; then touch $BOOKMARKS_FILE fi function mark() { echo $1 : $(pwd) >> $BOOKMARKS_FILE } fzfcmd() { [ ${FZF_TMUX:-1} -eq 1 ] && echo "fzf-tmux -d${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" } function jump() { local jumpline=$(cat ${BOOKMARKS_FILE} | $(fzfcmd) --bind=ctrl-y:accept --tac) if [[ -n ${jumpline} ]]; then local jumpdir=$(echo $jumpline | awk '{$1=$2="";print}' | xargs | sed "s#~#$HOME#") perl -p -i -e "s#${jumpline}\n##g" $BOOKMARKS_FILE cd "${jumpdir}" && echo ${jumpline} >> $BOOKMARKS_FILE fi } function dmark() { local marks_to_delete=$(cat $BOOKMARKS_FILE | $(fzfcmd) -m --bind=ctrl-y:accept,ctrl-t:toggle-up --tac) while read -r line; do perl -p -i -e "s#${line}\n##g" $BOOKMARKS_FILE done <<< "$marks_to_delete" echo "** The following marks were deleted **" echo ${marks_to_delete} } bind '"\C-g":"jump\n"'
Write messages to attempt to debug github CI
#!/bin/bash set -e ninja_path=`which ninja` if [ "$ninja_path" != "" ]; then build_system_prefix="ninja_" build_system="-G Ninja" else build_system="" build_system_prefix="" echo Warning: ninja not available! fi function generate { echo echo "====> Generating $1 ..." mkdir -p $1 cd $1 shift "$@" .. cd .. } gpp_path=`which g++` gcc_path=`which gcc` if [ "$gcc_path" != "" ]; then compiler="-DCMAKE_CXX_COMPILER=$gpp_path -DCMAKE_C_COMPILER=$gcc_path" generate "$build_system_prefix"release cmake $build_system -DCMAKE_BUILD_TYPE=Release $compiler generate "$build_system_prefix"debug cmake $build_system -DCMAKE_BUILD_TYPE=Debug $compiler generate "$build_system_prefix"coverage cmake $build_system -DCMAKE_BUILD_TYPE=Coverage $compiler fi clangpp_path=`which clang++` clang_path=`which clang` if [ "$clang_path" != "" ]; then generate "$build_system_prefix"clang cmake $build_system -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="$clangpp_path" -DCMAKE_C_COMPILER="$clang_path" fi
#!/bin/bash echo Generating cmake build directories... set -e ninja_path=`which ninja` if [ "$ninja_path" != "" ]; then build_system_prefix="ninja_" build_system="-G Ninja" else build_system="" build_system_prefix="" echo Warning: ninja not available! fi echo echo ======================================================================= echo ninja_path=$ninja_path echo build_system_prefix=$build_system_prefix echo build_system=$build_system function generate { echo echo "====> Generating $1 ..." mkdir -p $1 cd $1 shift "$@" .. cd .. } gpp_path=`which g++` gcc_path=`which gcc` echo echo ======================================================================= echo gpp_path=$gpp_path echo gcc_path=$gcc_path if [ "$gcc_path" != "" ]; then compiler="-DCMAKE_CXX_COMPILER=$gpp_path -DCMAKE_C_COMPILER=$gcc_path" generate "$build_system_prefix"release cmake $build_system -DCMAKE_BUILD_TYPE=Release $compiler generate "$build_system_prefix"debug cmake $build_system -DCMAKE_BUILD_TYPE=Debug $compiler generate "$build_system_prefix"coverage cmake $build_system -DCMAKE_BUILD_TYPE=Coverage $compiler fi clangpp_path=`which clang++` clang_path=`which clang` echo echo ======================================================================= echo clangpp_path=$clangpp_path echo clang_path=$clang_path if [ "$clang_path" != "" ]; then generate "$build_system_prefix"clang cmake $build_system -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="$clangpp_path" -DCMAKE_C_COMPILER="$clang_path" fi
Fix a permissions problem with building the assets if you run the script as root
#!/bin/sh # Update to the latest code from git echo "Upgrading gem system" gem update --system echo "Update from git" git checkout db/schema.rb git pull echo "Verify and install any new gems required." bundle install --deployment --without development test echo "Run database migrations if required." bundle exec rake db:migrate RAILS_ENV=production echo "Clear cached files." bundle exec rake tmp:cache:clear echo "Rebuild the CSS" bundle exec rake assets:precompile echo "Restart passenger." touch tmp/restart.txt echo "Restart the background processor." bundle exec lib/daemons/scheduler.rb restart
#!/bin/sh # Use this script to update jobsworth to the current version on whichever # git branch you are already on # It is designed to work with a passenger deployment, but it might work well # for other deployment choices as well APP_USER=`ls -l config/environment.rb | cut -b 15-22` # Update to the latest code from git echo "Upgrading gem system" gem update --system echo "Update from git" git checkout db/schema.rb git pull echo "Verify and install any new gems required." bundle install --deployment --without development test echo "Run database migrations if required." bundle exec rake db:migrate RAILS_ENV=production echo "Clear cached files." bundle exec rake tmp:cache:clear echo "Rebuild the CSS" bundle exec rake assets:precompile chown -R $APP_USER tmp public echo "Restart passenger." touch tmp/restart.txt echo "Restart the background processor." bundle exec lib/daemons/scheduler.rb restart
Fix to create repository script
#!/usr/bin/env bash # $REPOSITORY_NAMEで指定された名前のリポジトリをWORDのGitに作成します。 set -e git checkout master git push "ssh://git@gitolite.word-ac.net/${REPOSITORY_NAME}" master
#!/usr/bin/env bash # $REPOSITORY_NAMEで指定された名前のリポジトリをWORDのGitに作成します。 set -e git checkout master git pull origin master git push "ssh://git@gitolite.word-ac.net/${REPOSITORY_NAME}" master
Revise flagship to cd into base dir instead of app repo
#------------------------------------------------------------------------------- # # shell/dirs.zsh # Quick dir navigation commands # #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # # Directory Variables # #------------------------------------------------------------------------------- ICLOUD_HOME="$HOME/Library/Mobile Documents" ICLOUD_DRIVE="${ICLOUD_HOME}/com~apple~CloudDocs" #------------------------------------------------------------------------------- # # Directory Navigation (cd) # #------------------------------------------------------------------------------- alias icloud="cd $ICLOUD_HOME" alias iclouddrive="cd $ICLOUD_DRIVE" # Common Xcode project folders alias ol='cd ~/dev/ios/pods/Outlets' alias op='cd ~/dev/ios/Octopad' alias og='cd ~/dev/libgit2/objective-git' alias quick='cd ~/dev/ios/pods/Quick' alias nimble='cd ~/dev/ios/pods/Nimble' # KP Projects alias ebw='cd ~/dev/ios/EBW' alias fk='cd ~/dev/ios/pods/FitnessKit' alias itwire='cd ~/dev/bluemix/ITWire' alias flagship='cd ~/dev/ios/flagship/KPFlagship' # reflog, markdown alias rl='cd ~/dev/www/reflog/www' alias asv='cd ~/dev/markdown/AppleSoftwareVersions'
#------------------------------------------------------------------------------- # # shell/dirs.zsh # Quick dir navigation commands # #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # # Directory Variables # #------------------------------------------------------------------------------- ICLOUD_HOME="$HOME/Library/Mobile Documents" ICLOUD_DRIVE="${ICLOUD_HOME}/com~apple~CloudDocs" #------------------------------------------------------------------------------- # # Directory Navigation (cd) # #------------------------------------------------------------------------------- alias icloud="cd $ICLOUD_HOME" alias iclouddrive="cd $ICLOUD_DRIVE" # Common Xcode project folders alias ol='cd ~/dev/ios/pods/Outlets' alias op='cd ~/dev/ios/Octopad' alias og='cd ~/dev/libgit2/objective-git' alias quick='cd ~/dev/ios/pods/Quick' alias nimble='cd ~/dev/ios/pods/Nimble' # KP Projects alias ebw='cd ~/dev/ios/EBW' alias fk='cd ~/dev/ios/pods/FitnessKit' alias itwire='cd ~/dev/bluemix/ITWire' alias flagship='cd ~/dev/ios/flagship' # reflog, markdown alias rl='cd ~/dev/www/reflog/www' alias asv='cd ~/dev/markdown/AppleSoftwareVersions'
Fix up dependencies install in vagrant box
#!/bin/bash sudo apt-get update sudo apt-get install -y git sudo apt-get install -y python-virtualenv sudo apt-get install -y python-dev python-pip sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev # postgresql sudo apt-get install -y sqlite3 # for tests sudo apt-get install -y libsqlite3-dev # for tests sudo apt-get install -y postgresql-9.5 sudo apt-get install -y postgresql-client sudo apt-get install -y postgresql-server-dev-9.5 sudo apt-get install -y postgis sudo apt-get install -y postgresql-9.5-postgis-2.2 sudo apt-get install -y postgresql-9.5-postgis-2.2-scripts sudo apt-get install python-psycopg2 sudo apt-get install libpq-dev # GEOS sudo apt-get install -y binutils libproj-dev gdal-bin libgeos-3.5.0 libgeos-dev # redis sudo apt-get install -y redis-server # pip dependencies sudo pip install ipython #Unittest dependencies sudo apt-get install libsqlite3-mod-spatialite # fulltext Python library for extracting text from various file formats (for indexing). sudo apt-get install catdoc odt2txt antiword poppler-utils unrtf perl libimage-exiftool-perl html2text binutils unrar gzip bzip2 unzip docx2txt
#!/bin/bash sudo apt-get update sudo apt-get install -y git sudo apt-get install -y python-virtualenv sudo apt-get install -y python-dev python-pip sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev # postgresql sudo apt-get install -y sqlite3 # for tests sudo apt-get install -y libsqlite3-dev # for tests sudo apt-get install -y postgresql-9.5 sudo apt-get install -y postgresql-client sudo apt-get install -y postgresql-server-dev-9.5 sudo apt-get install -y postgis sudo apt-get install -y postgresql-9.5-postgis-2.2 sudo apt-get install -y postgresql-9.5-postgis-2.2-scripts sudo apt-get install python-psycopg2 sudo apt-get install libpq-dev # GEOS sudo apt-get install -y binutils libproj-dev gdal-bin libgeos-3.5.0 libgeos-dev # redis sudo apt-get install -y redis-server # pip dependencies sudo pip install ipython #Unittest dependencies sudo apt-get install -y libsqlite3-mod-spatialite # fulltext Python library for extracting text from various file formats (for indexing). sudo apt-get update sudo apt-get install -y catdoc odt2txt antiword poppler-utils unrtf perl libimage-exiftool-perl html2text binutils unrar gzip bzip2 unzip docx2txt
Remove confirmation when using rm
alias ~='cd ~' alias ..='cd ..' alias ...='cd ../..' alias beep="printf '\a'" alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' alias mkdir='mkdir -p' alias grep='grep --color=auto' # IP alias ip='dig +short myip.opendns.com @resolver1.opendns.com'
alias ~='cd ~' alias ..='cd ..' alias ...='cd ../..' alias beep="printf '\a'" alias cp='cp -i' alias mv='mv -i' alias mkdir='mkdir -p' alias grep='grep --color=auto' # IP alias ip='dig +short myip.opendns.com @resolver1.opendns.com'
Improve PowerTools config on Rocky Linux
#!/usr/bin/env bash koopa::rhel_install_base() { # {{{1 # """ # Install Red Hat Enterprise Linux (RHEL) base system. # @note Updated 2021-06-16. # # 'dnf-plugins-core' installs 'config-manager'. # """ local name_fancy powertools koopa::fedora_install_base "$@" # Early return for legacy RHEL 7 configs (e.g. Amazon Linux 2). if koopa::is_amzn || koopa::is_rhel_7_like then return 0 fi koopa::assert_is_installed 'dnf' 'sudo' name_fancy='Red Hat Enterprise Linux (RHEL) base system' koopa::install_start "$name_fancy" koopa::fedora_dnf_install 'dnf-plugins-core' 'util-linux-user' koopa::rhel_enable_epel if koopa::is_centos then powertools='powertools' else powertools='PowerTools' fi if ! koopa::is_rhel_ubi then koopa::fedora_dnf config-manager --set-enabled "$powertools" fi koopa::install_success "$name_fancy" return 0 }
#!/usr/bin/env bash koopa::rhel_install_base() { # {{{1 # """ # Install Red Hat Enterprise Linux (RHEL) base system. # @note Updated 2021-06-16. # # 'dnf-plugins-core' installs 'config-manager'. # """ local name_fancy powertools koopa::fedora_install_base "$@" # Early return for legacy RHEL 7 configs (e.g. Amazon Linux 2). if koopa::is_amzn || koopa::is_rhel_7_like then return 0 fi koopa::assert_is_installed 'dnf' 'sudo' name_fancy='Red Hat Enterprise Linux (RHEL) base system' koopa::install_start "$name_fancy" koopa::fedora_dnf_install 'dnf-plugins-core' 'util-linux-user' koopa::rhel_enable_epel if koopa::is_centos || koopa::is_rocky then powertools='powertools' else powertools='PowerTools' fi if ! koopa::is_rhel_ubi then koopa::fedora_dnf config-manager --set-enabled "$powertools" fi koopa::install_success "$name_fancy" return 0 }
Rebuild before creating a distribution
#!/bin/bash set -e version=$(grep -A1 "hammer-bench" pom.xml | grep -ioh "[0-9.]*") #mvn clean install DIST=hammer-bench-$version rm -rf $DIST mkdir $DIST cp -r scripts/* $DIST/ cp master.properties $DIST/ cp slave.properties $DIST/ cp target/hammer-bench-0.1.0-jar-with-dependencies.jar $DIST/hammer-bench.jar echo "Version: $version" > $DIST/VERSION echo "Built: `date`" >> $DIST/VERSION tar czf $DIST.tgz $DIST rm -rf $DIST scp $DIST.tgz repo.hops.works:/opt/repository/master/hammer-bench
#!/bin/bash set -e version=$(grep -A1 "hammer-bench" pom.xml | grep -ioh "[0-9.]*") mvn clean install DIST=hammer-bench-$version rm -rf $DIST mkdir $DIST cp -r scripts/* $DIST/ cp master.properties $DIST/ cp slave.properties $DIST/ cp target/hammer-bench-0.1.0-jar-with-dependencies.jar $DIST/hammer-bench.jar echo "Version: $version" > $DIST/VERSION echo "Built: `date`" >> $DIST/VERSION tar czf $DIST.tgz $DIST rm -rf $DIST scp $DIST.tgz repo.hops.works:/opt/repository/master/hammer-bench
Allow two-part OS X version numbers
#!/usr/bin/env bash # # Copyright (c) .NET Foundation and contributors. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. # export UNAME=$(uname) if [ -z "$RID" ]; then if [ "$UNAME" == "Darwin" ]; then export OSNAME=osx if [ -n "$(sw_vers -productVersion | grep 10.10.)" ]; then export RID=osx.10.10-x64 elif [ -n "$(sw_vers -productVersion | grep 10.11.)" ]; then export RID=osx.10.10-x64 else error "unknown OS X: $(sw_vers -productVersion)" 1>&2 fi elif [ "$UNAME" == "Linux" ]; then # Detect Distro if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then export OSNAME=ubuntu export RID=ubuntu.14.04-x64 elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then export OSNAME=centos export RID=centos.7.1-x64 else error "unknown Linux Distro" 1>&2 fi else error "unknown OS: $UNAME" 1>&2 fi fi if [ -z "$RID" ]; then exit 1 fi
#!/usr/bin/env bash # # Copyright (c) .NET Foundation and contributors. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. # export UNAME=$(uname) if [ -z "$RID" ]; then if [ "$UNAME" == "Darwin" ]; then export OSNAME=osx if [ -n "$(sw_vers -productVersion | grep 10.10)" ]; then export RID=osx.10.10-x64 elif [ -n "$(sw_vers -productVersion | grep 10.11)" ]; then export RID=osx.10.10-x64 else error "unknown OS X: $(sw_vers -productVersion)" 1>&2 fi elif [ "$UNAME" == "Linux" ]; then # Detect Distro if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then export OSNAME=ubuntu export RID=ubuntu.14.04-x64 elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then export OSNAME=centos export RID=centos.7.1-x64 else error "unknown Linux Distro" 1>&2 fi else error "unknown OS: $UNAME" 1>&2 fi fi if [ -z "$RID" ]; then exit 1 fi
Remove hard-coded host name from dummy server test script
#!/bin/sh curl -X POST -d @request.json http://latrice.local:9000/response.json --header "Content-Type:application/json"
#!/bin/sh curl -X POST -d @request.json http://`hostname`:9000/response.json --header "Content-Type:application/json"
Build the right things into the release tarball
#!/bin/sh # --- # help-text: Build the vantage binary # requires: # - test # --- set -e . venv/bin/activate pyinstaller --noconfirm --clean --onedir --name vantage vantage/__main__.py VERSION=$(vantage __version) cp -r dist "vantage-$VERSION" cp install.sh README.md LICENSE "vantage-$VERSION/" tar -cvzf "vantage-$VERSION.tar.gz" "vantage-$VERSION"
#!/bin/sh # --- # help-text: Build the vantage binary # requires: # - test # --- set -e . venv/bin/activate pyinstaller --noconfirm --clean --onedir --name vantage vantage/__main__.py VERSION=$(vantage __version) cp -r dist "vantage-$VERSION" cp install.sh README.md LICENSE "vantage-$VERSION/" tar -cvzf "vantage-$VERSION.tar.gz" -C "vantage-$VERSION" .
Fix bug on ip not always working???
#!/bin/sh # When using a dynamic IP and a router that asks for a password every time to see the status page, # access that page and grep the IP address for upload to a public site. # This is useful when gaming with friends or you need to publish your IP for other reasons. # Currently the script supports the following router: TW-LTE/4G/3G router, WiFI AC echo "Enter router password (won't be echoed)." stty_orig=`stty -g` stty -echo read pw stty $stty_orig username=$(whoami) ip=$(wget http://10.0.0.1/adm/status.asp --user=$username --password=$pw -q -O - | grep 'id="idv4wanip"' | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}") if test "X$ip" == "X" then echo "Error." exit fi echo echo WAN IP: $ip echo # Use a secret script to upload contents of $ip variable somewhere publicly available. if [ -e ~/.scripts_extra/publish_ip.sh ] then echo -n "Press return to publish WAN IP." read sh ~/.scripts_extra/publish_ip.sh $ip 2>/dev/null echo "Done." fi
#!/bin/sh # When using a dynamic IP and a router that asks for a password every time to see the status page, # access that page and grep the IP address for upload to a public site. # This is useful when gaming with friends or you need to publish your IP for other reasons. # Currently the script supports the following router: TW-LTE/4G/3G router, WiFI AC echo "Enter router password (won't be echoed)." stty_orig=`stty -g` stty -echo read pw stty $stty_orig username=$(whoami) ip=$(wget http://10.0.0.1/adm/status.asp --user=$username --password=$pw -q -O - | grep 'id="idv4wanip"' | grep -o "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}") echo echo WAN IP: $ip echo if test "X$ip" == "X" then echo "Error." exit fi # Use a secret script to upload contents of $ip variable somewhere publicly available. if [ -e ~/.scripts_extra/publish_ip.sh ] then echo -n "Press return to publish WAN IP." read sh ~/.scripts_extra/publish_ip.sh $ip 2>/dev/null echo "Done." fi
Fix default value which use existing NODE_ADDRESS_PREFIX if present.
#!/usr/bin/env bash env_dir=$(dirname "${BASH_SOURCE}") source ${env_dir}/common.sh export NODE_OS_DISTRO='ubuntu' export NODE_IMAGE="/var/lib/libvirt/images/ubuntu-xenial-docker-ec2-noclouds.qcow2" export NODE_ADDRESS_PREFIX='192.168.201' export NODE_NET_DEVICE='ens3' export NODE_ADDITIONAL_DISKS=''
#!/usr/bin/env bash env_dir=$(dirname "${BASH_SOURCE}") source ${env_dir}/common.sh export NODE_OS_DISTRO='ubuntu' export NODE_IMAGE="/var/lib/libvirt/images/ubuntu-xenial-docker-ec2-noclouds.qcow2" export NODE_ADDRESS_PREFIX=${NODE_ADDRESS_PREFIX:-'192.168.201'} export NODE_NET_DEVICE='ens3' export NODE_ADDITIONAL_DISKS=''
Update download script with new GCP github org url
#!/bin/bash # Copyright 2021 Google LLC # # 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 # # https://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. mkdir scripts cd scripts wget https://raw.githubusercontent.com/VeerMuchandi/MigratingFromOpenShiftToGKE/main/scripts/migrateScript1.sh wget https://raw.githubusercontent.com/VeerMuchandi/MigratingFromOpenShiftToGKE/main/scripts/migrateScript2.sh wget https://raw.githubusercontent.com/VeerMuchandi/MigratingFromOpenShiftToGKE/main/scripts/exportApplicationManifests.sh wget https://raw.githubusercontent.com/VeerMuchandi/MigratingFromOpenShiftToGKE/main/scripts/exportSecrets.sh chmod +x *.sh cd ..
#!/bin/bash # Copyright 2021 Google LLC # # 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 # # https://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. mkdir scripts cd scripts wget https://raw.githubusercontent.com/GoogleCloudPlatform/MigratingFromOpenShiftToGKE/main/scripts/migrateScript1.sh wget https://raw.githubusercontent.com/GoogleCloudPlatform/MigratingFromOpenShiftToGKE/main/scripts/migrateScript2.sh wget https://raw.githubusercontent.com/GoogleCloudPlatform/MigratingFromOpenShiftToGKE/main/scripts/exportApplicationManifests.sh wget https://raw.githubusercontent.com/GoogleCloudPlatform/MigratingFromOpenShiftToGKE/main/scripts/exportSecrets.sh chmod +x *.sh cd ..
Fix tagging in build scripts
owner="orbit" repo="orbit" tag=v$TAG_VERSION GH_REPO="https://api.github.com/repos/$owner/$repo" AUTH="Authorization: token $GITHUB_TOKEN" # Commit all changed work git commit -m "Release version $tag and update docs" --author="orbit-tools <orbit@ea.com>" # Get commit id commitId=$(git rev-parse HEAD) # Tag commit with the intended release tag (without the underscore) git tag "$tag" git push origin master --tags git push origin :refs/tags/$tag git reset --hard # Read asset tags. releaseResponse=$(curl -sH "$AUTH" "$GH_REPO/releases/tags/_$tag") # Extract the release id eval $(echo "$releaseResponse" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=') [ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$releaseResponse" | awk 'length($0)<100' >&2; exit 1; } # Patch release with new commit Id and tag curl -X PATCH -H "$AUTH" -H "Content-Type: application/json" $GH_REPO/releases/$id -d '{"tag_name": "$tag", "target_commitish": "$commitId"}'
owner="orbit" repo="orbit" tag=v$TAG_VERSION GH_REPO="https://api.github.com/repos/$owner/$repo" AUTH="Authorization: token $GITHUB_TOKEN" # Commit all changed work git commit -m "Release version $tag and update docs" --author="orbit-tools <orbit@ea.com>" # Get commit id commitId=$(git rev-parse HEAD) # Read asset tags. releaseResponse=$(curl -sH "$AUTH" "$GH_REPO/releases/tags/_$tag") # Extract the release id eval $(echo "$releaseResponse" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=') [ "$id" ] || { echo "Error: Failed to get release id for tag: $tag"; echo "$releaseResponse" | awk 'length($0)<100' >&2; exit 1; } # Patch release with new commit Id and tag curl -X PATCH -H "$AUTH" -H "Content-Type: application/json" $GH_REPO/releases/$id -d '{"tag_name": "$tag", "target_commitish": "$commitId"}' # Tag commit with the intended release tag (without the underscore) git tag $tag git push origin master --tags git tag -d _$tag git push origin :refs/tags/_$tag git reset --hard
Integrate with iTerm2 when possible
# Sourced by /bin/zsh # Inherits from the all shell env. source $HOME/.shellenv # Load default completions autoload -Uz compinit compinit zstyle ':completion:*' menu select setopt COMPLETE_ALIASES # Load pure (https://github.com/sindresorhus/pure) autoload -U promptinit; promptinit prompt pure # Load up other plugins source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh fpath=(/usr/local/share/zsh-completions $fpath)
# Sourced by /bin/zsh # Inherits from the all shell env. source $HOME/.shellenv # Load default completions autoload -Uz compinit compinit zstyle ':completion:*' menu select setopt COMPLETE_ALIASES # Load pure (https://github.com/sindresorhus/pure) autoload -U promptinit; promptinit prompt pure # Load up other plugins source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh fpath=(/usr/local/share/zsh-completions $fpath) # Load up the iTerm2 shell integration if present test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
Remove semi-extraneous fpm --iteration from the package.
fpm_args+=(--iteration 5) case "$TARGET" in debian* | ubuntu*) fpm_depends+=('libpq-dev' 'nginx | apache2') ;; centos*) fpm_depends+=('postgresql-devel') ;; esac # Exclude all files and directories matched by .gitignore for i in `git status --ignored --porcelain |grep '^!!' |sed -e 's/^!! //' |grep -v git-commit.version |grep -v vendor/bundle`; do fpm_exclude+=("var/www/arvados-sso/current/$i") done
case "$TARGET" in debian* | ubuntu*) fpm_depends+=('libpq-dev' 'nginx | apache2') ;; centos*) fpm_depends+=('postgresql-devel') ;; esac # Exclude all files and directories matched by .gitignore for i in `git status --ignored --porcelain |grep '^!!' |sed -e 's/^!! //' |grep -v git-commit.version |grep -v vendor/bundle`; do fpm_exclude+=("var/www/arvados-sso/current/$i") done
Use redshift to adjust screen temperature
source $HOME/.profile # $HOME/bin/earthwall/earthwall.sh& feh --bg-scale /home/rl/Pictures/wallpaper.jpg start-pulseaudio-x11 clipmenud& compton& thunderbird& clipmenud& dunst& wmname LG3D blueman-applet& $HOME/dotfiles/bin/scripts/status.sh& xflux -l 37.2 -g -3.61 exec dbus-launch `dwm 2> /tmp/dwm.log`
source $HOME/.profile feh --bg-scale $HOME/Pictures/wallpaper.jpg start-pulseaudio-x11 #compton& clipmenud& dunst& wmname LG3D blueman-applet& $HOME/dotfiles/bin/scripts/status.sh& redshift -l 37.2:-3.61 & exec dbus-launch `dwm 2> /tmp/dwm.log`
Rearrange logic for listing prebuilt packages
#!/bin/bash # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== set -e set -x source tensorflow/tools/ci_build/release/common.sh sudo pip install --upgrade twine # Copy and rename to tf_nightly for f in $(ls "${TF_FILE_DIR}"/tf_nightly_gpu*dev*cp3*-cp3*-win_amd64.whl); do copy_to_new_project_name "${f}" tf_nightly done # Upload the built packages to pypi. for f in $(ls "${TF_FILE_DIR}"/tf_nightly*dev*cp3*-cp3*-win_amd64.whl); do twine upload -r pypi-warehouse "$f" || echo done
#!/bin/bash # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== set -e set -x source tensorflow/tools/ci_build/release/common.sh sudo pip install --upgrade twine # Copy and rename to tf_nightly for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly_gpu*dev*cp3*-cp3*-win_amd64.whl); do copy_to_new_project_name "${f}" tf_nightly done # Upload the built packages to pypi. for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly*dev*cp3*-cp3*-win_amd64.whl); do twine upload -r pypi-warehouse "$f" || echo done
Add neovim Python package installation
#!/bin/sh # # Description: installs python and python packages if [ ! -x /usr/local/bin/brew ]; then echo "ERROR: Homebrew must be installed to run the python.sh installer script" exit 1 fi if [ ! -x /usr/local/bin/python ]; then echo "Installing python..." brew install python --framework --with-brewed-openssl fi echo "Current python: `which python`" echo "Installing python packages..." if [ -x $CONFIGS_DIR/python_local.sh ]; then $CONFIGS_DIR/python_local.sh fi exit 0
#!/bin/sh # # Description: installs python and python packages if [ ! -x /usr/local/bin/brew ]; then echo "ERROR: Homebrew must be installed to run the python.sh installer script" exit 1 fi if [ ! -x /usr/local/bin/python ]; then echo "Installing python..." brew install python --framework --with-brewed-openssl fi echo "Current python: `which python`" echo "Installing python packages..." pip2 install --user neovim if [ -x $CONFIGS_DIR/python_local.sh ]; then $CONFIGS_DIR/python_local.sh fi exit 0
Add delay to allow wifi device to become ready
#!/bin/bash # Bring all wifi interfaces down. # Identify wifi interfaces as rows from standard output of iwconfig (NOT standard # error, those are non-wifi interfaces) which start without whitespace. iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done # Bring all wifi interfaces up. iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
#!/bin/bash # Bring all wifi interfaces down. # Identify wifi interfaces as rows from standard output of iwconfig (NOT standard # error, those are non-wifi interfaces) which start without whitespace. sleep 30 iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done # Bring all wifi interfaces up. sleep 30 iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
Improve kill script to be faster and smarter.
SCRIPTDIR=$(cd $(dirname "$0") && pwd) # Attempt to kill ROS if it is already running echo "Killing everything, please wait a moment . . ." pkill -f metatron_id.launch pkill ngrok sleep 10 pkill roslaunch sleep 10 pkill roscore sleep 1 echo "Everything Killed." # If you want to be able to reset the ports, # you need to add the script resetUSB.sh to the /etc/sudoers file, # like this: #chrisl8 ALL = NOPASSWD: /home/chrisl8/metatron/scripts/resetUSB.sh sudo -nl|grep resetUSB > /dev/null if [ $? -eq 0 ] then sudo -n ${SCRIPTDIR}/resetUSB.sh fi
SCRIPTDIR=$(cd $(dirname "$0") && pwd) # Attempt to kill ROS if it is already running echo "Killing everything, please wait a moment . . ." if (pkill -f metatron_id.launch) then while (pgrep -f metatron_id.launch) do echo "Waiting for Metatron to close . . ." sleep 1 done fi if (pkill ngrok) then while (pgrep ngrok) do echo "Waiting for ngrok to close . . ." sleep 1 done fi if (pkill -f "arlobot_bringup minimal.launch") then while (pgrep -f "arlobot_bringup minimal.launch") do echo "Waiting for Arlobot to close . . ." sleep 1 done fi if (pkill roslaunch) then while (pgrep roslaunch) do echo "Waiting for roslaunch to close . . ." sleep 1 done fi if (pkill roscore) then while (pgrep roscore) do echo "Waiting for roscore to close . . ." sleep 1 done fi echo "Everything Killed." # If you want to be able to reset the ports, # you need to add the script resetUSB.sh to the /etc/sudoers file, # like this: #chrisl8 ALL = NOPASSWD: /home/chrisl8/metatron/scripts/resetUSB.sh sudo -nl|grep resetUSB > /dev/null if [ $? -eq 0 ] then sudo -n ${SCRIPTDIR}/resetUSB.sh fi
Update script with example docs
arg_host=$1 if [ -z "$1" ] then arg_host="localhost" fi echo $arg_host docker run -d -p 5672:5672 -p 15672:15672 cybercom/rabbitmq source config.sh #sleep to allow for container ports to become active until wget $arg_host:15672/cli/rabbitmqadmin do sleep 5 done chmod +x rabbitmqadmin && \ ./rabbitmqadmin -H $arg_host declare vhost name=$vhost && \ ./rabbitmqadmin -H $arg_host declare user name=$user password=$password tags=$tag && \ ./rabbitmqadmin -H $arg_host declare permission vhost=$vhost user=$user configure=".*" write=".*" read=".*"
#!/bin/sh # # Mark Stacy # arg_host added to accomidate boot2docker # ./run.sh <boot2docker ip> # # Default is localhost # ./run.sh arg_host=$1 if [ -z "$1" ] then arg_host="localhost" fi echo $arg_host docker run -d -p 5672:5672 -p 15672:15672 cybercom/rabbitmq source config.sh #sleep to allow for container ports to become active until wget $arg_host:15672/cli/rabbitmqadmin do sleep 5 done chmod +x rabbitmqadmin && \ ./rabbitmqadmin -H $arg_host declare vhost name=$vhost && \ ./rabbitmqadmin -H $arg_host declare user name=$user password=$password tags=$tag && \ ./rabbitmqadmin -H $arg_host declare permission vhost=$vhost user=$user configure=".*" write=".*" read=".*"
Upgrade CI to Docker 19.03.14
#!/bin/bash set -e version="19.03.13" echo "https://download.docker.com/linux/static/stable/x86_64/docker-$version.tgz";
#!/bin/bash set -e version="19.03.14" echo "https://download.docker.com/linux/static/stable/x86_64/docker-$version.tgz";
Add a static library build to circleci.
#!/usr/bin/env bash # Echo each command set -x # Exit on error. set -e # Core deps. sudo apt-get install build-essential cmake libgmp-dev libmpfr-dev curl # Create the build dir and cd into it. mkdir build cd build # GCC build. cmake ../ -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=Debug -DMPPP_BUILD_TESTS=YES -DMPPP_WITH_MPFR=yes -DMPPP_WITH_QUADMATH=yes -DCMAKE_CXX_FLAGS="--coverage -fconcepts -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC" make -j2 VERBOSE=1 # Run the tests. ctest -V # Upload coverage data. bash <(curl -s https://codecov.io/bash) -x gcov-7 > /dev/null set +e set +x
#!/usr/bin/env bash # Echo each command set -x # Exit on error. set -e # Core deps. sudo apt-get install build-essential cmake libgmp-dev libmpfr-dev curl # Create the build dir and cd into it. mkdir build cd build # GCC build. cmake ../ -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=Debug -DMPPP_BUILD_TESTS=YES -DMPPP_WITH_MPFR=yes -DMPPP_WITH_QUADMATH=yes -DCMAKE_CXX_FLAGS="--coverage -fconcepts -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC" -DMPPP_BUILD_STATIC_LIBRARY=yes make -j2 VERBOSE=1 # Run the tests. ctest -V # Upload coverage data. bash <(curl -s https://codecov.io/bash) -x gcov-7 > /dev/null set +e set +x
Set up build for SFML bleeding edge version.
#!/usr/bin/env sh echo cloning SFML... git clone https://github.com/LaurentGomila/SFML.git echo DONE
#!/usr/bin/env sh sudo apt-get install libpthread-stubs0-dev sudo apt-get install libgl1-mesa-dev sudo apt-get install libx11-dev sudo apt-get install libxrandr-dev sudo apt-get install libfreetype6-dev sudo apt-get install libglew1.5-dev sudo apt-get install libjpeg8-dev sudo apt-get install libsndfile1-dev sudo apt-get install libopenal-dev cd .. git clone https://github.com/LaurentGomila/SFML.git cd SFML cmake . && make && sudo make install
Copy the .deb for the updated template
#!/bin/bash set -e export DATE=$(date +%Y-%m-%d) #make dragonfly #AWS_PROFILE=dragonfly-ecr #AWS_REGION=us-east-1 # #aws configure --profile ${AWS_PROFILE} set aws_access_key_id ${AWS_ACCESS_KEY_ID} #aws configure --profile ${AWS_PROFILE} set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY} #aws configure --profile ${AWS_PROFILE} set region ${AWS_REGION} #eval $(aws ecr get-login --profile ${AWS_PROFILE} | sed 's| -e none||') # #make aws cp /input/MPI-Latex-Templates/mpi-latex-templates_1.44_all.deb dragonfly-reports/ DOCKERHUB_USERNAME=deployhub1 docker login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD} make dockerhub exit $?
#!/bin/bash set -e export DATE=$(date +%Y-%m-%d) #make dragonfly #AWS_PROFILE=dragonfly-ecr #AWS_REGION=us-east-1 # #aws configure --profile ${AWS_PROFILE} set aws_access_key_id ${AWS_ACCESS_KEY_ID} #aws configure --profile ${AWS_PROFILE} set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY} #aws configure --profile ${AWS_PROFILE} set region ${AWS_REGION} #eval $(aws ecr get-login --profile ${AWS_PROFILE} | sed 's| -e none||') # #make aws cp /input/MPI-Latex-Templates/mpi-latex-templates_1.45_all.deb dragonfly-reports/ DOCKERHUB_USERNAME=deployhub1 docker login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD} make dockerhub exit $?
Test for COVERAGE instead of CODECOV_TOKEN.
#!/bin/sh # Copyright 2019-2021 Yury Gribov # # Use of this source code is governed by MIT license that can be # found in the LICENSE.txt file. set -eu if test -n "${TRAVIS:-}" -o -n "${GITHUB_ACTIONS:-}"; then set -x fi cd $(dirname $0)/.. export ASAN_OPTIONS='detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:strict_string_checks=1' make "$@" clean all make "$@" check # Upload coverage if test -n "${CODECOV_TOKEN:-}"; then curl --retry 5 -s https://codecov.io/bash > codecov.bash bash codecov.bash -Z fi
#!/bin/sh # Copyright 2019-2021 Yury Gribov # # Use of this source code is governed by MIT license that can be # found in the LICENSE.txt file. set -eu if test -n "${TRAVIS:-}" -o -n "${GITHUB_ACTIONS:-}"; then set -x fi cd $(dirname $0)/.. export ASAN_OPTIONS='detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:strict_string_checks=1' make "$@" clean all make "$@" check # Upload coverage if test -n "${COVERAGE:-}"; then curl --retry 5 -s https://codecov.io/bash > codecov.bash bash codecov.bash -Z fi
Add github token to push changes back to github
#!/bin/bash set -ev echo "current git hash:" git rev-parse --short HEAD saveMavenSettings() { cat >$HOME/.m2/settings.xml <<EOL <?xml version='1.0' encoding='UTF-8'?> <settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <servers> <server> <id>bintray</id> <username>${BINTRAY_USER}</username> <password>${BINTRAY_PASS}</password> </server> <server> <id>github</id> <username>${GITHUB_USER}</username> <password>${GITHUB_TOKEN}</username> </server> </servers> </settings> EOL } if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ "${RELEASE}" = "true" ]; then echo "Deploying release to Bintray" saveMavenSettings git checkout -f ${TRAVIS_BRANCH} mvn release:clean release:prepare release:perform -B -e -Pbintray fi
#!/bin/bash set -ev echo "current git hash:" git rev-parse --short HEAD saveMavenSettings() { cat >$HOME/.m2/settings.xml <<EOL <?xml version='1.0' encoding='UTF-8'?> <settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd' xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <servers> <server> <id>bintray</id> <username>${BINTRAY_USER}</username> <password>${BINTRAY_PASS}</password> </server> <server> <id>github</id> <username>${GITHUB_USER}</username> <password>${GITHUB_TOKEN}</password> </server> </servers> </settings> EOL } if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ "${RELEASE}" = "true" ]; then echo "Deploying release to Bintray" saveMavenSettings git checkout -f ${TRAVIS_BRANCH} mvn release:clean release:prepare release:perform -B -e -Pbintray fi
Fix port on web server script
#!/bin/sh -eu PORT="55555" if [ $# -eq 1 ]; then PORT="$1" fi EXEC="mono " if [ -e "/c/" ]; then EXEC="" fi if [ ! -e build/CommandLine/CommandLine.exe ]; then >&2 xbuild /target:CommandLine GitHub.Unity.sln /verbosity:minimal fi "$EXEC"build/CommandLine/CommandLine.exe --web --port $PORT
#!/bin/sh -eu PORT="50000" if [ $# -eq 1 ]; then PORT="$1" fi EXEC="mono " if [ -e "/c/" ]; then EXEC="" fi if [ ! -e build/CommandLine/CommandLine.exe ]; then >&2 xbuild /target:CommandLine GitHub.Unity.sln /verbosity:minimal fi "$EXEC"build/CommandLine/CommandLine.exe --web --port $PORT
Fix script for running ci test to send correct event_type.
#!/usr/bin/env bash if [ -z "$AERON_GITHUB_PAT" ] then echo "Please set AERON_GITHUB_PAT environment variable to contain your token" exit -1 fi event_type=run-tests for option in "$@" do case ${option} in -s|--slow) event_type=run-slow-tests shift ;; -c|--commit) shift ;; *) echo "$0 [-s|--slow-tests] (run slow tests) [-c|--commit] (run commit tests) default: commit tests" exit ;; esac done echo "Sending repository_dispatch, event_type: ${event_type}" curl -H "Accept: application/vnd.github.everest-preview+json" \ -H "Authorization: token ${AERON_GITHUB_PAT}" \ --request POST \ --data '{"event_type": "${event_type}"}' \ https://api.github.com/repos/real-logic/aeron/dispatches
#!/usr/bin/env bash if [ -z "$AERON_GITHUB_PAT" ] then echo "Please set AERON_GITHUB_PAT environment variable to contain your token" exit -1 fi event_type=run-commit-tests for option in "$@" do case ${option} in -s|--slow) event_type=run-slow-tests shift ;; -c|--commit) shift ;; *) echo "$0 [-s|--slow-tests] (run slow tests) [-c|--commit] (run commit tests) default: commit tests" exit ;; esac done echo "Sending repository_dispatch, event_type: ${event_type}" curl -v -H "Accept: application/vnd.github.everest-preview+json" \ -H "Authorization: token ${AERON_GITHUB_PAT}" \ --request POST \ --data "{\"event_type\": \"${event_type}\"}" \ https://api.github.com/repos/real-logic/aeron/dispatches
Add shebang to specify shell.
exit_script() { if [[ -z ${KEEP} ]] ; then docker ps -a | awk '{ print $1,$2 }' | grep $CONTAINER | awk '{print $1 }' | xargs -I {} docker rm -f {} fi echo "${error}Process exited${normal}" trap - SIGINT SIGTERM # clear the trap kill -- -$$ # Sends SIGTERM to child/sub processes } trap exit_script SIGINT SIGTERM
#!/bin/bash exit_script() { if [[ -z ${KEEP} ]] ; then docker ps -a | awk '{ print $1,$2 }' | grep $CONTAINER | awk '{print $1 }' | xargs -I {} docker rm -f {} fi echo "${error}Process exited${normal}" trap - SIGINT SIGTERM # clear the trap kill -- -$$ # Sends SIGTERM to child/sub processes } trap exit_script SIGINT SIGTERM
Add shmem test into the list
#!/bin/bash TESTS="\ sync_simple\ async_simple\ sync_args\ async_fds\ " RES="" for TST in $TESTS; do echo "Running $TST" make clean || exit 1 make OBJ=$TST test || exit 1 tail -n1 piggie.out | fgrep -q PASS && RES="$RES\n$TST: PASS" || RES="$RES\n$TST: FAIL" done ./run_cli.sh && RES="$RES\nCLI: PASS" || RES="$RES\nCLI: FAIL" echo -e "$RES"
#!/bin/bash TESTS="\ sync_simple\ async_simple\ sync_args\ async_fds\ async_shmem\ " RES="" for TST in $TESTS; do echo "Running $TST" make clean || exit 1 make OBJ=$TST test || exit 1 tail -n1 piggie.out | fgrep -q PASS && RES="$RES\n$TST: PASS" || RES="$RES\n$TST: FAIL" done ./run_cli.sh && RES="$RES\nCLI: PASS" || RES="$RES\nCLI: FAIL" echo -e "$RES"
Improve git diff, and run configuration only if git is set-up
#!/usr/bin/env bash REV=$(uname -r) # Installs git if [[ $REV = *"ARCH"* ]]; then echo "ArchLinux" sudo pacman -S --needed git elif hash apt-get 2>/dev/null; then echo "Debian" sudo apt-get install git # Installs git-extras sudo apt-get update sudo apt-get install git-extras fi # TODO: configure GPG keys if type git >/dev/null 2>&1 then git config --global user.name "Ian Lai" git config --global user.email "ian@fyianlai.com" fi git config --global core.excludesfile ~/.gitignore_global git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX" git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit" git config --global rebase.autoStash true true git config --global remote.origin.prune true git config --global core.editor "nano"
#!/usr/bin/env bash REV=$(uname -r) # Installs git if [[ $REV = *"ARCH"* ]]; then echo "ArchLinux" sudo pacman -S --needed git elif hash apt-get 2>/dev/null; then echo "Debian" sudo apt-get install git # Installs git-extras sudo apt-get update sudo apt-get install git-extras fi # TODO: configure GPG keys if type git >/dev/null 2>&1 then echo "Setting up git ..." git config --global user.name "Ian Lai" git config --global user.email "ian@fyianlai.com" git config --global core.excludesfile ~/.gitignore_global git config --global rebase.autoStash true true git config --global remote.origin.prune true git config --global core.editor "nano" git config --global alias.tree "log --graph --decorate --pretty=oneline --abbrev-commit" # https://github.com/so-fancy/diff-so-fancy git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX" git config --global color.ui true git config --global color.diff-highlight.oldNormal "red bold" git config --global color.diff-highlight.oldHighlight "red bold 52" git config --global color.diff-highlight.newNormal "green bold" git config --global color.diff-highlight.newHighlight "green bold 22" git config --global color.diff.meta "yellow" git config --global color.diff.frag "magenta bold" git config --global color.diff.commit "yellow bold" git config --global color.diff.old "red bold" git config --global color.diff.new "green bold" git config --global color.diff.whitespace "red reverse" fi
Update hooks runner to allow non-existent files and report running hooks
#!/usr/bin/env bash hookName=$(basename $0) hookPathStart=$GL_ADMIN_BASE/hooks/common/.generated/$hookName commonScope=$hookPathStart.common.* repositoryScope=$hookPathStart.repository.$(echo $GL_REPO | sed "s/\//-/g").* for hook in $(ls -1 $commonScope $repositoryScope) do . $hook done
#!/usr/bin/env bash hookName=$(basename $0) hooksRoot=$GL_ADMIN_BASE/hooks/common/.generated repositoryName=$(echo $GL_REPO | sed "s/\//-/g") hookPattern="^$hookName\.(common|repository\.$repositoryName)\." for hook in $(ls -1 $hooksRoot | egrep $hookPattern) do echo "Hooking $hook" . $hooksRoot/$hook done
Update ppa script to build package for trusty, utopic and vivid
#! /bin/bash # package info ppa="ppa:colin-duquesnoy/experimental" name="qdarkstyle" version="1.16" debian_version=1 # read pgp key from gpg_key file gpg_key=`cat gpg_key` # generate debian source package and .orig.tar.gz python3 setup.py --command-packages=stdeb.command sdist_dsc --suite trusty --debian-version ${debian_version} # sign our package and prepare it for ppa upload pushd deb_dist dpkg-source -x ${name}_${version}-${debian_version}.dsc pushd ${name}-${version} debuild -S -sa -k${gpg_key} popd # upload to ppa dput ${ppa} *.changes popd # cleanup rm -rf *.tar.gz deb_dist/ dist/
#! /bin/bash # package info ppa="ppa:colin-duquesnoy/experimental" name="qdarkstyle" version="1.16" # read pgp key from gpg_key file gpg_key=`cat gpg_key` # generate debian source package and .orig.tar.gz python3 setup.py --command-packages=stdeb.command sdist_dsc date=`date -R` # clean pyc files find . -name "*.pyc" -exec rm -rf {} \; for suite in 'trusty' 'utopic' 'vivid' do # sign our package and prepare it for ppa upload pushd deb_dist pushd ${name}-${version} # update changelog to include ubuntu release changelog="${name} (${version}-1ppa1~${suite}1) ${suite}; urgency=low * Initial release -- Colin Duquesnoy <colin.duquesnoy@gmail.com> ${date} " echo "$changelog" > debian/changelog cat debian/changelog debuild -S -sa -k${gpg_key} popd # upload to ppa dput ${ppa} *.changes rm -rf *.dsc *.changes popd done # cleanup rm -rf *.tar.gz deb_dist/ dist/
Fix ffmpeg, now not install from epel
# Copyright © 2017 Feature.su. All rights reserved. # Licensed under the Apache License, Version 2.0 yum -y install epel-release yum -y install psmisc yum -y install mc telnet nano traceroute yum -y install wget net-tools yum -y install bind-utils ntpdate dstat yum -y install rdiff-backup rsync sshpass sshfs yum -y install policycoreutils-python setools yum -y install pwgen yum -y install supervisor yum -y install unzip p7zip yum -y install yum-utils yum -y install aspell-en yum -y install certbot yum -y install smartmontools dmidecode lm_sensors yum -y install python-pip yum -y install deltarpm yum -y install sysstat yum -y install ffmpeg yum -y install p7zip systemctl enable sysstat systemctl start sysstat mkdir /etc/linux.feature chmod 700 /etc/linux.feature chcon -t admin_home_t /etc/linux.feature mkdir /var/backup chmod 700 /var/backup chcon -t admin_home_t /var/backup mkdir /iso/
# Copyright © 2017 Feature.su. All rights reserved. # Licensed under the Apache License, Version 2.0 yum -y install epel-release yum -y install psmisc yum -y install mc telnet nano traceroute yum -y install wget net-tools yum -y install bind-utils ntpdate dstat yum -y install rdiff-backup rsync sshpass sshfs yum -y install policycoreutils-python setools yum -y install pwgen yum -y install supervisor yum -y install unzip p7zip yum -y install yum-utils yum -y install aspell-en yum -y install certbot yum -y install smartmontools dmidecode lm_sensors yum -y install python-pip yum -y install deltarpm yum -y install sysstat cd /tmp wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm rpm -Uvh /tmp/nux-dextop-release-0-5.el7.nux.noarch.rpm yum -y install ffmpeg systemctl enable sysstat systemctl start sysstat mkdir /etc/linux.feature chmod 700 /etc/linux.feature chcon -t admin_home_t /etc/linux.feature mkdir /var/backup chmod 700 /var/backup chcon -t admin_home_t /var/backup mkdir /iso/
Put Sequal Pro and MAMP into the Dock.
#!/bin/sh clear_dock () { defaults write com.apple.dock persistent-apps -array } dock () { DIRECTORY="/Users/`whoami`/Applications/$1.app"; XML="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>${DIRECTORY}</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>" defaults write com.apple.dock persistent-apps -array-add "$XML" } restart_dock() { killall -SIGHUP Dock } clear_dock dock "Google Chrome" dock "Firefox" dock "GitHub" dock "iTerm" dock "Dash" dock "GitHub" dock "Skype" dock "Spotify" dock "PhpStorm" dock "VMWare Fusion" restart_dock
#!/bin/sh clear_dock () { defaults write com.apple.dock persistent-apps -array } dock () { DIRECTORY="/Users/`whoami`/Applications/$1.app"; XML="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>${DIRECTORY}</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>" defaults write com.apple.dock persistent-apps -array-add "$XML" } full_dock () { DIRECTORY="$1.app"; XML="<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>${DIRECTORY}</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>" defaults write com.apple.dock persistent-apps -array-add "$XML" } restart_dock() { killall -SIGHUP Dock } clear_dock dock "Google Chrome" dock "Firefox" dock "GitHub" full_dock "/Applications/MAMP/Sequel Pro" dock "iTerm" dock "Dash" full_dock "/Applications/MAMP/MAMP" dock "Skype" dock "Spotify" dock "PhpStorm" dock "VMWare Fusion" restart_dock
Configure colors for nose-progressive to look decent with solarized.
export PYTHONSTARTUP=$HOME/.dotfiles/python/startup/startup.py export PYTHONPATH=$PYTHONPATH export PYTHONUSERDIR=$HOME/.dotfiles/python/startup export PROJECT_HOME=$PROJECTS export WORKON_HOME=$HOME/.virtualenvs export PIP_VIRTUALENV_BASE=$WORKON_HOME export PIP_RESPECT_VIRTUALENV=true source `which virtualenvwrapper_lazy.sh`
export PYTHONSTARTUP=$HOME/.dotfiles/python/startup/startup.py export PYTHONPATH=$PYTHONPATH export PYTHONUSERDIR=$HOME/.dotfiles/python/startup export PROJECT_HOME=$PROJECTS export WORKON_HOME=$HOME/.virtualenvs export PIP_VIRTUALENV_BASE=$WORKON_HOME export PIP_RESPECT_VIRTUALENV=true source `which virtualenvwrapper_lazy.sh` export NOSE_PROGRESSIVE_FUNCTION_COLOR=0 export NOSE_PROGRESSIVE_DIM_COLOR=11 export NOSE_PROGRESSIVE_BAR_FILLED_COLOR=2 export NOSE_PROGRESSIVE_BAR_EMPTY_COLOR=7
Exclude .cvsignore files from the distribution.
#!/bin/sh # # $Id: build-dist.sh,v 1.1 2001/08/12 03:59:21 mdb Exp $ # # Builds a distribution archive. This should be run from the top-level # project directory and it will place the distribution archive into the # directory identified by $DISTDIR. USAGE="Usage: $0 distname (eg. viztool-1.4)" DISTDIR=dist if [ -z "$1" ]; then echo $USAGE exit -1 else TARGET=$1 fi # build our excludes file cat > .excludes <<EOF build-dist.sh CVS dist lib/*.jar code .excludes EOF # create our distribution directory mkdir /tmp/$TARGET # temporarily move the distribution files into temp so that we can put # them into a properly named directory tar --exclude-from=.excludes -cf - * | tar -C /tmp/$TARGET -xf - # now build the actual archive file tar -C /tmp -czf $DISTDIR/$TARGET.tgz $TARGET # and clean up after ourselves rm -rf /tmp/$TARGET rm .excludes
#!/bin/sh # # $Id: build-dist.sh,v 1.2 2001/08/12 04:21:13 mdb Exp $ # # Builds a distribution archive. This should be run from the top-level # project directory and it will place the distribution archive into the # directory identified by $DISTDIR. USAGE="Usage: $0 distname (eg. viztool-1.4)" DISTDIR=dist if [ -z "$1" ]; then echo $USAGE exit -1 else TARGET=$1 fi # build our excludes file cat > .excludes <<EOF build-dist.sh CVS dist lib/*.jar code .excludes .cvsignore EOF # create our distribution directory mkdir /tmp/$TARGET # temporarily move the distribution files into temp so that we can put # them into a properly named directory tar --exclude-from=.excludes -cf - * | tar -C /tmp/$TARGET -xf - # now build the actual archive file tar -C /tmp -czf $DISTDIR/$TARGET.tgz $TARGET # and clean up after ourselves rm -rf /tmp/$TARGET rm .excludes
Fix mingw toolchain for cross-compiling Taglib
#!/usr/bin/env bash set -e . ../build_config.sh rm -rf tmp mkdir tmp cd tmp echo "Building taglib $TAGLIB_VERSION" curl -SLO http://taglib.github.io/releases/$TAGLIB_VERSION.tar.gz tar -xf $TAGLIB_VERSION.tar.gz cd $TAGLIB_VERSION/ TAGLIB_TOOLCHAIN=" SET(CMAKE_SYSTEM_NAME Windows) SET(CMAKE_C_COMPILER $HOST-gcc) SET(CMAKE_CXX_COMPILER $HOST-g++) SET(CMAKE_RC_COMPILER $HOST-windres) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) " echo "$TAGLIB_TOOLCHAIN" > $TAGLIB_VERSION_toolchain.cmake cmake \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=$TAGLIB_VERSION_toolchain.cmake \ -DBUILD_SHARED_LIBS=OFF \ -DZLIB_ROOT=$PREFIX \ . make # patch taglib.cp (missing -lz flag) sed -i 's/-ltag/-ltag -lz/g' taglib.pc make install cd ../.. rm -r tmp mv $PREFIX/bin/libtag.dll $PREFIX/lib
#!/usr/bin/env bash set -e . ../build_config.sh rm -rf tmp mkdir tmp cd tmp echo "Building taglib $TAGLIB_VERSION" curl -SLO http://taglib.github.io/releases/$TAGLIB_VERSION.tar.gz tar -xf $TAGLIB_VERSION.tar.gz cd $TAGLIB_VERSION/ TAGLIB_TOOLCHAIN=" set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_C_COMPILER $HOST-gcc) set(CMAKE_CXX_COMPILER $HOST-g++) set(CMAKE_RC_COMPILER $HOST-windres) set(CMAKE_FIND_ROOT_PATH /usr/$HOST) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) " echo "$TAGLIB_TOOLCHAIN" > ${TAGLIB_VERSION}_toolchain.cmake cmake \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=${TAGLIB_VERSION}_toolchain.cmake \ -DBUILD_SHARED_LIBS=OFF \ -DZLIB_ROOT=$PREFIX \ . make # patch taglib.cp (missing -lz flag) sed -i 's/-ltag/-ltag -lz/g' taglib.pc make install cd ../.. rm -r tmp mv $PREFIX/bin/libtag.dll $PREFIX/lib
Use versioning for the prebuilt browser bundles
#!/bin/bash set -e rm -rf doc/ || exit 0 npm run docs cd doc/ git init git config user.name "not-an-aardvark" git config user.email "not-an-aardvark@users.noreply.github.com" git add . git commit -qm "Docs for commit $TRAVIS_COMMIT" git push -fq "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
#!/bin/bash set -e rm -rf doc/ || exit 0 git clone "https://${GH_REF}" --branch gh-pages --single-branch doc npm run docs cp doc/snoowrap.js "doc/snoowrap-$TRAVIS_TAG.js" cp doc/snoowrap.min.js "doc/snoowrap-$TRAVIS_TAG.min.js" cd doc/ git config user.name "not-an-aardvark" git config user.email "not-an-aardvark@users.noreply.github.com" git add -A git commit -qm "Docs for commit $TRAVIS_COMMIT" git push -q "https://${GH_TOKEN}@${GH_REF}" gh-pages > /dev/null 2>&1
Make use of current to support different HDP versions
#!/bin/bash /usr/hdp/2.2.0.0-2041/kafka/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic stock_topic
#!/bin/bash /usr/hdp/current/kafka-broker/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic stock_topic
Expand -p to --python for virtualenv command
#!/bin/bash # functions.sh # Caleb Evans # Reloads entire shell, including .bash_profile and any activated virtualenv reload() { deactivate 2> /dev/null exec $SHELL -l } # Makes new Python virtualenv for current directory mkvirtualenv() { virtualenv -p "$1" "$VIRTUAL_ENV_NAME" # Activate virtualenv so packages can be installed source ./"$VIRTUAL_ENV_NAME"/bin/activate } # Removes existing Python virtualenv rmvirtualenv() { rm -r ./"$VIRTUAL_ENV_NAME" } # Flushes all DNS caches for OS X 10.10.4 and onward flushdns() { sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder }
''#!/bin/bash # functions.sh # Caleb Evans # Reloads entire shell, including .bash_profile and any activated virtualenv reload() { deactivate 2> /dev/null exec $SHELL -l } # Makes new Python virtualenv for current directory mkvirtualenv() { virtualenv --python="$1" "$VIRTUAL_ENV_NAME" # Activate virtualenv so packages can be installed source ./"$VIRTUAL_ENV_NAME"/bin/activate } # Removes existing Python virtualenv rmvirtualenv() { rm -r ./"$VIRTUAL_ENV_NAME" } # Flushes all DNS caches for OS X 10.10.4 and onward flushdns() { sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder }
Fix Docker image version for develop builds
#!/bin/bash set -ex TAG=$(git describe --tags) BRANCH=$(git rev-parse --abbrev-ref HEAD) DIST_VERSION=$TAG # If the branch comes out as HEAD then we're probably checked out to a tag, so if the thing is *not* # coming out as HEAD then we're on a branch. When we're on a branch, we want to resolve ourselves to # a few SHAs rather than a version. # Docker Hub doesn't always check out the tag and sometimes checks out the branch, so we should look # for an appropriately tagged branch as well (heads/v1.2.3). if [ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ] then REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD) JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD) VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA fi echo $DIST_VERSION > /src/webapp/version
#!/bin/sh set -ex TAG=$(git describe --tags) BRANCH=$(git rev-parse --abbrev-ref HEAD) DIST_VERSION=$TAG # If the branch comes out as HEAD then we're probably checked out to a tag, so if the thing is *not* # coming out as HEAD then we're on a branch. When we're on a branch, we want to resolve ourselves to # a few SHAs rather than a version. # Docker Hub doesn't always check out the tag and sometimes checks out the branch, so we should look # for an appropriately tagged branch as well (heads/v1.2.3). if [[ $BRANCH != 'HEAD' && $BRANCH != 'heads/v*' ]] then REACT_SHA=$(cd node_modules/matrix-react-sdk; git rev-parse --short=12 HEAD) JSSDK_SHA=$(cd node_modules/matrix-js-sdk; git rev-parse --short=12 HEAD) VECTOR_SHA=$(git rev-parse --short=12 HEAD) # use the ACTUAL SHA rather than assume develop DIST_VERSION=$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA fi echo $DIST_VERSION > /src/webapp/version
Make build:example correctly build SVG for new examples
dir=${dir-"examples/compiled"} for name in "$@" do echo "Compiling $name" # to $dir (nopatch=$nopatch, forcesvg=$forcesvg)" # compile normalized example if $skipnormalize is not set if [ ! -n "$skipnormalize" ]; then #build full vl example scripts/build-normalized-example $name.vl.json fi # compile Vega example rm -f examples/compiled/$name.vg.json bin/vl2vg -p examples/specs/$name.vl.json > examples/compiled/$name.vg.json if (! git diff $nopatch --exit-code HEAD -- $dir/$name.vg.json || $forcesvg) then rm -f examples/compiled/$name.svg node_modules/vega/bin/vg2svg --seed 123456789 examples/compiled/$name.vg.json > examples/compiled/$name.svg -b . fi done
dir=${dir-"examples/compiled"} for name in "$@" do echo "Compiling $name" # to $dir (nopatch=$nopatch, forcesvg=$forcesvg)" # compile normalized example if $skipnormalize is not set if [ ! -n "$skipnormalize" ]; then #build full vl example scripts/build-normalized-example $name.vl.json fi # compile Vega example rm -f examples/compiled/$name.vg.json bin/vl2vg -p examples/specs/$name.vl.json > examples/compiled/$name.vg.json # compile SVG if one of the following condition is true # 1) Vega spec has changed # 2) The SVG file does not exist (new example would not have vg file diff) # or 3) the forcesvg environment variable is true if (! git diff $nopatch --exit-code HEAD -- $dir/$name.vg.json || [ ! -f $dir/$name.svg ] || $forcesvg) then rm -f examples/compiled/$name.svg node_modules/vega/bin/vg2svg --seed 123456789 examples/compiled/$name.vg.json > examples/compiled/$name.svg -b . fi done
Add some checks and debug output to docker start script.
#!/bin/bash DATA_DIR="/data/hecuba/${HOSTNAME}/" mkdir -p ${DATA_DIR} java -jar -Djava.io.tmpdir=${DATA_DIR} /uberjar.jar
#!/bin/bash CONFIG_FILE=/.hecuba.edn DATA_DIR="/data/hecuba/${HOSTNAME}/" mkdir -p ${DATA_DIR} CASSANDRA_SESSION_KEYSPACE=${HECUBA_KEYSPACE?NOT DEFINED} S3_FILE_BUCKET=${HECUBA_FILE_BUCKET?NOT DEFINED} S3_STATUS_BUCKET=${HECUBA_STATUS_BUCKET?NOT DEFINED} echo "DATA_DIR is ${DATA_DIR}" echo "CASSANDRA_SESSION_KEYSPACE is ${CASSANDRA_SESSION_KEYSPACE}" echo "S3_FILE_BUCKET is ${S3_FILE_BUCKET}" echo "S3_STATUS_BUCKET is ${S3_STATUS_BUCKET}" echo <<EOF > ${CONFIG_FILE} { :cassandra-session {:keyspace :${CASSANDRA_SESSION_KEYSPACE} :hecuba-session {:keyspace ${CASSANDRA_SESSION_KEYSPACE}} :search-session {:host "${ES01_TCP_PORT_9200_ADDR}" } :s3 {:access-key "${AWS_ACCESS_KEY_ID:?NOT DEFINED}" :secret-key "${AWS_SECRET_ACCESS_KEY:?NOT DEFINED}" :file-bucket "${S3_FILE_BUCKET}" :status-bucket "${S3_STATUS_BUCKET}" :download-dir "${DATA_DIR}"} } EOF export HOME=/ java -jar -Djava.io.tmpdir=${DATA_DIR} /uberjar.jar
Add hh function and more aliases
#!/usr/bin/env bash function usage_exit() { argc="$1" && shift argc_check="$1" && shift usage="$1" && shift if (( argc != argc_check )) then echo "Usage: $usage" exit 1 fi } function azify() { # http://stackoverflow.com/a/23816607/469045 echo "$@" | tr -dc '[:alnum:]' | tr '[:upper:]' '[:lower:]' } # aliases alias ls="ls --color --group-directories-first"
#!/usr/bin/env bash # aliases alias cp="cp -i" alias ls="ls --color --group-directories-first" alias mv="mv -i" alias rm="rm -i" # functions function hh() { hostname uname -a lsb_release -a } # Used by percent.sh, for example: # usage_exit "$#" 2 "`basename $0` part total" "$@" function usage_exit() { # args: argc argc_check usage argc="$1" && shift argc_check="$1" && shift usage="$1" && shift if (( argc != argc_check )) then echo "Usage: $usage" exit 1 fi } function azify() { # http://stackoverflow.com/a/23816607/469045 echo "$@" | tr -dc '[:alnum:]' | tr '[:upper:]' '[:lower:]' }
Install newer sqlite3 version in dev machine
# Shell file taken at: https://github.com/rails/rails-dev-box function install { echo installing $1 shift apt-get -y install "$@" >/dev/null 2>&1 } echo updating package information apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1 apt-get -y update >/dev/null 2>&1 install 'development tools' build-essential install Ruby ruby2.3 ruby2.3-dev update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1 update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1 echo installing Bundler gem install bundler -N >/dev/null 2>&1 install Git git install SQLite sqlite3 libsqlite3-dev install PostgreSQL postgresql postgresql-contrib libpq-dev sudo -u postgres createdb -O postgres xylem_test install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev # Needed for docs generation. update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 echo 'ready to roll out'
# Shell file taken at: https://github.com/rails/rails-dev-box function install { echo installing $1 shift apt-get -y install "$@" >/dev/null 2>&1 } echo updating package information export DEBIAN_FRONTEND=noninteractive curl -sSL "https://ftp-master.debian.org/keys/archive-key-7.0.asc" | sudo -E apt-key add - echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list > /dev/null apt-add-repository -y ppa:brightbox/ruby-ng >/dev/null 2>&1 apt-get -y update >/dev/null 2>&1 install 'development tools' build-essential install Ruby ruby2.3 ruby2.3-dev update-alternatives --set ruby /usr/bin/ruby2.3 >/dev/null 2>&1 update-alternatives --set gem /usr/bin/gem2.3 >/dev/null 2>&1 echo installing Bundler gem install bundler -N >/dev/null 2>&1 install Git git install SQLite sqlite3 libsqlite3-dev install PostgreSQL postgresql postgresql-contrib libpq-dev sudo -u postgres createdb -O postgres xylem_test install 'Nokogiri dependencies' libxml2 libxml2-dev libxslt1-dev # Needed for docs generation. update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 echo 'ready to roll out'
Add Sublime Text to command line
#!/bin/sh brew install ruby python python3 node git tmux # Symlink configurations ln -s ~/Code/dotfiles/sublime_text/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/Preferences.sublime-settings ln -s ~/Code/dotfiles/.bash_profile ~/.bash_profile ln -s ~/Code/dotfiles/.bashrc ~/.bashrc ln -s ~/Code/dotfiles/.vimrc ~/.vimrc # Make holding down a key work in Sublime Text vintage mode defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false
#!/bin/sh brew install ruby python python3 node git tmux # Symlink configurations ln -s ~/Code/dotfiles/sublime_text/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/Preferences.sublime-settings ln -s ~/Code/dotfiles/.bash_profile ~/.bash_profile ln -s ~/Code/dotfiles/.bashrc ~/.bashrc ln -s ~/Code/dotfiles/.vimrc ~/.vimrc # Make holding down a key work in Sublime Text vintage mode defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false # Open Sublime Text from the command line sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl
Add alias for quick git root navigation
alias .=pwd alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias -- -='cd -' alias g=git alias v=vim alias df='cd ~/dotfiles' alias speedtest='wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip' # Lyft alias phoenix='cd ~/Developer/Lyft-iOS'
alias .=pwd alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias -- -='cd -' alias g=git # https://www.quora.com/How-can-I-make-a-git-alias-that-executes-a-cd alias gr='cd $(git rev-parse --show-toplevel)' alias v=vim alias df='cd ~/dotfiles' alias speedtest='wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip'
Allow DATACENTER to be define from the environment
#!/bin/bash set -e DATACENTER=federation force=false if [ "$1" = "--force" ]; then force=true shift fi count=$(git status --porcelain | wc -l) if test "$count" -gt 0; then git status if $force; then echo "WARNING: Not all files have been committed in Git." echo "Will continue as --force is with you" else echo "Not all files have been committed in Git. Release aborted" exit 1 fi fi ./common/scripts/bootstrap.sh ansible-playbook --ask-become-pass -i envs/$DATACENTER/etc/ansible/ \ -e play_dir="$(pwd)" \ -e lib_roles_path="$(pwd)/roles" \ -e datacenter="$DATACENTER" "$@" \ install.yml
#!/bin/bash set -e : ${DATACENTER:=federation} force=false if [ "$1" = "--force" ]; then force=true shift fi count=$(git status --porcelain | wc -l) if test "$count" -gt 0; then git status if $force; then echo "WARNING: Not all files have been committed in Git." echo "Will continue as --force is with you" else echo "Not all files have been committed in Git. Release aborted" exit 1 fi fi ./common/scripts/bootstrap.sh ansible-playbook --ask-become-pass -i envs/$DATACENTER/etc/ansible/ \ -e play_dir="$(pwd)" \ -e lib_roles_path="$(pwd)/roles" \ -e datacenter="$DATACENTER" "$@" \ install.yml
Revert "Use --force-with-lease instead of --force"
#!/bin/sh set -e INPUT_FORCE=${INPUT_FORCE:-false} INPUT_TAGS=${INPUT_TAGS:-false} INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'} _FORCE_OPTION='' REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY} echo "Push to branch $INPUT_BRANCH"; [ -z "${INPUT_GITHUB_TOKEN}" ] && { echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".'; exit 1; }; if ${INPUT_FORCE}; then _FORCE_OPTION='--force-with-lease' fi if ${INPUT_TAGS}; then _TAGS='--tags' fi cd ${INPUT_DIRECTORY} remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git" git config --local --add safe.directory ${INPUT_DIRECTORY} git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
#!/bin/sh set -e INPUT_FORCE=${INPUT_FORCE:-false} INPUT_TAGS=${INPUT_TAGS:-false} INPUT_DIRECTORY=${INPUT_DIRECTORY:-'.'} _FORCE_OPTION='' REPOSITORY=${INPUT_REPOSITORY:-$GITHUB_REPOSITORY} echo "Push to branch $INPUT_BRANCH"; [ -z "${INPUT_GITHUB_TOKEN}" ] && { echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".'; exit 1; }; if ${INPUT_FORCE}; then _FORCE_OPTION='--force' fi if ${INPUT_TAGS}; then _TAGS='--tags' fi cd ${INPUT_DIRECTORY} remote_repo="${INPUT_GITHUB_URL_PROTOCOL}//${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@${INPUT_GITHUB_URL}/${REPOSITORY}.git" git config --local --add safe.directory ${INPUT_DIRECTORY} git push "${remote_repo}" HEAD:${INPUT_BRANCH} --follow-tags $_FORCE_OPTION $_TAGS;
Fix bash script to not need hg shelve
#!/bin/bash NEW_FILE="$1" OLD_FILE="$2" SHELF_NAME="compare-times-shelf" trap "hg unshelve --name $SHELF_NAME" SIGINT SIGTERM # make the old version hg shelve --all --name $SHELF_NAME make clean make timed 2>&1 | tee "$OLD_FILE" # make the current version hg unshelve --all --name $SHELF_NAME make clean make timed 2>&1 | tee "$NEW_FILE"
#!/bin/bash NEW_FILE="$1" OLD_FILE="$2" SHELF_NAME="compare-times-shelf" trap "hg import --no-commit $SHELF_NAME" SIGINT SIGTERM # make the old version #hg shelve --all --name $SHELF_NAME hg diff > $SHELF_NAME && hg revert -a make clean make timed 2>&1 | tee "$OLD_FILE" # make the current version hg import --no-commit $SHELF_NAME && mv $SHELF_NAME "$SHELF_NAME-$(date | base64).bak" make clean make timed 2>&1 | tee "$NEW_FILE"
Add the Top 2000 position when it's the Top 2000 time
#!/usr/bin/env bash # Get the now playing data. nowplaying_data=$(curl --max-time 4 -s "http://radiobox2.omroep.nl/data/radiobox2/nowonair/2.json?npo_cc_skip_wall=1") # Get the artist. # "artist":"Bob Dylan" artist=$(echo "$nowplaying_data" | sed 's/.*"artist":"\([^"]*\)".*/\1/') # Get the track. # "title":"It's Alright Ma (I'm Only Bleeding)" track=$(echo "$nowplaying_data" | sed 's/.*"title":"\([^"]*\)".*/\1/') echo "#[fg=colour246]♫ ${track} - #[bold]${artist}"
#!/usr/bin/env bash TOP2000_FILE="/var/tmp/top2000-$(date +%Y)" TOP2000=false # Download this year's Top 2000 list. if [ ! -f $TOP2000_FILE ]; then curl -fsLo $TOP2000_FILE "http://www.nporadio2.nl/index.php?option=com_ajax&plugin=Top2000&format=json&year=$(date +%Y)&npo_cc_skip_wall=1" fi current_date=$(date +%m%d) if [ $current_date -ge 2225 -a $current_date -le 2231 ]; then TOP2000=true fi top2000_data=$(cat $TOP2000_FILE) # Get the now playing data. nowplaying_data=$(curl --max-time 4 -s "http://radiobox2.omroep.nl/data/radiobox2/nowonair/2.json?npo_cc_skip_wall=1") # Get the artist. # "artist":"Bob Dylan" artist=$(echo "$nowplaying_data" | sed 's/.*"artist":"\([^"]*\)".*/\1/') # Get the track. # "title":"It's Alright Ma (I'm Only Bleeding)" track=$(echo "$nowplaying_data" | sed 's/.*"title":"\([^"]*\)".*/\1/') # Get the Top 2000 position. if $TOP2000; then position=$(echo "$top2000_data" | grep -Zoi "{\"s\":\"${track}\",\"a\":\"${artist}\"[^}]*}" | sed 's/.*"pos":\([^"]*\),.*/\1/') top2000_position=" #[fg=colour001](${position})" fi echo "#[fg=colour246]♫ ${track} - #[bold]${artist}${top2000_position}"
Update the queries table with the new json file.
ROOT=/home/jason/Workspace/StoryTeller LIB="$ROOT"/target RESOURCES="$( cd $ROOT && cd .. && pwd)"/vua-resources SERVER="http://145.100.58.139:50053" LIMIT="100" ID=$1 QUERY=$2 java -Xmx2000m -cp "$LIB/StoryTeller-v1.0-jar-with-dependencies.jar" vu.cltl.storyteller.json.JsonMakeStoryFromTripleData $QUERY --ks-limit $LIMIT --ks-service $SERVER --log --token-index token.index.gz --eurovoc $RESOURCES/mapping_eurovoc_skos.label.concept.gz > $ID.json
ROOT=/home/romulo/maarten/StoryTeller LIB="$ROOT"/target DB="$ROOT"../query-builder-server RESOURCES="$( cd $ROOT && cd .. && pwd)"/vua-resources SERVER="http://145.100.58.139:50053" LIMIT="100" ID=$1 QUERY=$2 java -Xmx2000m -cp "$LIB/StoryTeller-v1.0-jar-with-dependencies.jar" vu.cltl.storyteller.json.JsonMakeStoryFromTripleData $QUERY --ks-limit $LIMIT --ks-service $SERVER --log --token-index token.index.gz --eurovoc $RESOURCES/mapping_eurovoc_skos.label.concept.gz > $ID.json ./update_queries.py $DB/data/storyteller.db $ID $ID.json
Correct name of Zoom cask
#!/usr/bin/env bash source ~/dotfiles/setup/header.sh echo "Installing Homebrew Casks..." preload_cask_list # Install essential macOS apps via Cask (in order of essentiality) install_cask google-chrome install_cask dropbox install_cask alfred install_cask atom install_cask authy install_cask evernote install_cask keyboard-maestro install_cask flux # Install additional apps install_cask appcleaner install_cask namechanger install_cask the-unarchiver install_cask mamp rm -rf '/Applications/MAMP PRO' install_cask keybase install_cask postman install_cask slack install_cask zoomus install_cask vlc echo "Installing Quick Look plugins..." install_cask qlstephen install_cask qlmarkdown install_cask scriptql install_cask quicklook-json install_cask betterzip install_cask suspicious-package qlmanage -r
#!/usr/bin/env bash source ~/dotfiles/setup/header.sh echo "Installing Homebrew Casks..." preload_cask_list # Install essential macOS apps via Cask (in order of essentiality) install_cask google-chrome install_cask dropbox install_cask alfred install_cask atom install_cask authy install_cask evernote install_cask keyboard-maestro install_cask flux # Install additional apps install_cask appcleaner install_cask namechanger install_cask the-unarchiver install_cask mamp rm -rf '/Applications/MAMP PRO' install_cask keybase install_cask postman install_cask slack install_cask zoom install_cask vlc echo "Installing Quick Look plugins..." install_cask qlstephen install_cask qlmarkdown install_cask scriptql install_cask quicklook-json install_cask betterzip install_cask suspicious-package qlmanage -r
Add create alias and activate alias
#!/bin/bash VIRTUALENV_PATH=~/.python/virtualenv.py VIRTUALENVS_DIR=~/.virtualenvs function venv { if [ "$1" == "c" ]; then if [ -n "$2" ]; then name=$2 else echo "Please enter name of the new env"; return 1; fi _virtualenv $VIRTUALENVS_DIR/$name --no-site-packages; return 0; fi if [ "$1" == "a" ]; then if [ -n "$2" ]; then name=$2 else echo "Please enter name of the env which wants to activate"; return 1; fi source $VIRTUALENVS_DIR/$name/bin/activate; return 0; fi _virtualenv; return 0; } function _virtualenv { python $VIRTUALENV_PATH $@ }
Add disable disk quota stub to manifest generation script
set -e -x -u num_cells=$1 cd ~/workspace/diego-release ./scripts/generate-deployment-manifest aws ../cf-release ~/workspace/deployments-runtime/diego-1/stubs/* ~/workspace/deployments-runtime/diego-1/performance-stubs/${num_cells}-cell.yml ~/workspace/deployments-runtime/diego-1/performance-stubs/debug_logging.yml > ~/workspace/deployments-runtime/diego-1/deployments/diego-${num_cells}-cell.yml
if [ -z "$1" ]; then echo "Usage: $0 <num_cells>" echo " <num_cells> must be one of '10', '20', '50', or '100'" exit 1 fi set -e -x -u num_cells=$1 cd ~/workspace/diego-release ./scripts/generate-deployment-manifest \ aws \ ../cf-release \ ~/workspace/deployments-runtime/diego-1/stubs/* \ ~/workspace/deployments-runtime/diego-1/performance-stubs/${num_cells}-cell.yml \ ~/workspace/deployments-runtime/diego-1/performance-stubs/debug_logging.yml \ ~/workspace/deployments-runtime/diego-1/performance-stubs/disable_disk_quota.yml \ > ~/workspace/deployments-runtime/diego-1/deployments/diego-${num_cells}-cell.yml
Add all files in dist
#!/bin/sh set -o errexit -o nounset # config git config user.email "nobody@nobody.org" git config user.name "Travis CI" # set the remote git remote add upstream "https://$GITHUB_TOKEN@github.com/open-curriculum/oerschema.git" # Add, Commit and Push git add dist git commit -m "Auto push from Travis" git push upstream `git subtree split --prefix dist master`:gh-pages --force
#!/bin/sh set -o errexit -o nounset # config git config user.email "nobody@nobody.org" git config user.name "Travis CI" # set the remote git remote add upstream "https://$GITHUB_TOKEN@github.com/open-curriculum/oerschema.git" # Add, Commit and Push git add -A dist git commit -m "Auto push from Travis" git push upstream `git subtree split --prefix dist master`:gh-pages --force
Fix "bad pattern" errors for Zsh 5.0
export P4VERSION=$(command p4 -V | awk -F/ '/Rev. P4/ {print $3}') p4() { typeset -a args local args=( $@ ) local cmd=$args[1] local p4aliases=$HOME/.p4aliases local bp4oaliases=${XDG_CONFIG_HOME:-$HOME/.config}/bp4o/aliases if [ ${P4VERSION%.*} -ge 2016 ] && [ -f $p4aliases ]; then # Search for and apply aliases from Perforce local p4cmd=$(perl -n -e "print if \$_ =~ s/^$args[1]\b.*=\s*(\w+).*/\1/" $p4aliases) if [ -n "$p4cmd" ]; then cmd=$p4cmd fi elif [ -f $bp4oaliases ]; then # Search for and apply aliases from BP4O local alias=$(perl -n -e "print if \$_ =~ s/$args[1]\s*=\s*(.+)/\1/" $bp4oaliases) if [ -n "$alias" ]; then args=( ${=args/#$args[1]/$alias} ) cmd=$args[1] fi fi p4bin=$(whence -p p4) if command which p4-$cmd &>/dev/null; then p4-$cmd $p4bin $args else $p4bin $args fi }
export P4VERSION=$(command p4 -V | awk -F/ '/Rev. P4/ {print $3}') p4() { local args cmd args=( $@ ) cmd=$args[1] local p4aliases=$HOME/.p4aliases local bp4oaliases=${XDG_CONFIG_HOME:-$HOME/.config}/bp4o/aliases if [ ${P4VERSION%.*} -ge 2016 ] && [ -f $p4aliases ]; then # Search for and apply aliases from Perforce local p4cmd=$(perl -n -e "print if \$_ =~ s/^$args[1]\b.*=\s*(\w+).*/\1/" $p4aliases) if [ -n "$p4cmd" ]; then cmd=$p4cmd fi elif [ -f $bp4oaliases ]; then # Search for and apply aliases from BP4O local alias=$(perl -n -e "print if \$_ =~ s/$args[1]\s*=\s*(.+)/\1/" $bp4oaliases) if [ -n "$alias" ]; then args=( ${=args/#$args[1]/$alias} ) cmd=$args[1] fi fi p4bin=$(whence -p p4) if command which p4-$cmd &>/dev/null; then p4-$cmd $p4bin $args else $p4bin $args fi }
Allow coveralls:push rake task to fail
#!/usr/bin/env bash # # script.sh # # This file is meant to be sourced during the `script` phase of the Travis # build. Do not attempt to source or run it locally. # # shellcheck disable=SC1090 . "${TRAVIS_BUILD_DIR}/ci/travis/helpers.sh" enter_build_step header 'Running script.sh...' run bundle exec rake test:coverage run bundle exec rake coveralls:push run bundle exec rake rubocop if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then TRAVIS_BRANCH_COMMIT="$(git rev-parse --verify -q "${TRAVIS_BRANCH}")" TRAVIS_COMMIT_RANGE="${TRAVIS_BRANCH_COMMIT}..${TRAVIS_COMMIT}" else TRAVIS_LAST_COMMIT="$(git rev-parse --verify -q "${TRAVIS_COMMIT}^")" TRAVIS_COMMIT_RANGE="${TRAVIS_LAST_COMMIT}..${TRAVIS_COMMIT}" fi # audit any modified casks (download if version, sha256, or url changed) run developer/bin/audit_modified_casks "${TRAVIS_COMMIT_RANGE}" exit_build_step
#!/usr/bin/env bash # # script.sh # # This file is meant to be sourced during the `script` phase of the Travis # build. Do not attempt to source or run it locally. # # shellcheck disable=SC1090 . "${TRAVIS_BUILD_DIR}/ci/travis/helpers.sh" enter_build_step header 'Running script.sh...' run bundle exec rake test:coverage run bundle exec rake coveralls:push || true # in case of networking errors run bundle exec rake rubocop if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then TRAVIS_BRANCH_COMMIT="$(git rev-parse --verify -q "${TRAVIS_BRANCH}")" TRAVIS_COMMIT_RANGE="${TRAVIS_BRANCH_COMMIT}..${TRAVIS_COMMIT}" else TRAVIS_LAST_COMMIT="$(git rev-parse --verify -q "${TRAVIS_COMMIT}^")" TRAVIS_COMMIT_RANGE="${TRAVIS_LAST_COMMIT}..${TRAVIS_COMMIT}" fi # audit any modified casks (download if version, sha256, or url changed) run developer/bin/audit_modified_casks "${TRAVIS_COMMIT_RANGE}" exit_build_step
Make the lint not strict
#!/bin/bash set -e if [ -e ./build/ ]; then rm -rf ./build/ fi moonc -l ./src/ cp -r ./src/ ./build/ moonc ./build/ find ./build/ -name "*.moon" -delete for FILE in patches/*patch; do patch -p0 -u <$FILE; done
#!/bin/bash set -e if [ -e ./build/ ]; then rm -rf ./build/ fi moonc -l ./src/ || true cp -r ./src/ ./build/ moonc ./build/ find ./build/ -name "*.moon" -delete for FILE in patches/*patch; do patch -p0 -u <$FILE; done
Add message about subcommand listing
if [[ $# -gt 0 ]] then if [[ -d "$DIR/commands/$1" ]] then echosuccess Available Commands: find $DIR/commands/$1 -name "*.bash" | sed s/index//g | sed s/.bash//g | awk '{n=split($0,array,"/"); print " " array[n-1] " " array[n]}' | sort else echo Service "$1" is not supported fi else echosuccess Supported Services: ls $DIR/commands | sort | sed 's/^/ /' fi
if [[ $# -gt 0 ]] then if [[ -d "$DIR/commands/$1" ]] then echosuccess Available Commands: find $DIR/commands/$1 -name "*.bash" | sed s/index//g | sed s/.bash//g | awk '{n=split($0,array,"/"); print " " array[n-1] " " array[n]}' | sort else echo Service "$1" is not supported fi else echo "Run 'awsinfo commands SERVICE' to see a list of all available commands for the SERVICE" echo "e.g. 'awsinfo commands route53'" echosuccess Supported Services: ls $DIR/commands | sort | sed 's/^/ /' fi
Add executable bits to downloaded binary.
#!/usr/bin/env bash # Try install by # - download binary # - build with cargo set -o nounset # error when referencing undefined variable set -o errexit # exit when command fails set -o pipefail version=0.1.11 name=languageclient function try_curl() { command -v curl > /dev/null && \ curl --fail --location $1 --output bin/$name } function try_wget() { command -v wget > /dev/null && \ wget --output-document=bin/$name $1 } function download() { echo "Downloading bin/${name}..." local url=https://github.com/autozimu/LanguageClient-neovim/releases/download/$version/${1} if (try_curl $url || try_wget $url); then return else echo "Failed to download with curl and wget" try_build fi } function try_build() { echo "Trying build locally ..." make release } arch=$(uname -sm) binary="" case "${arch}" in Linux\ *64) download $name-$version-x86_64-unknown-linux-musl ;; Linux\ *86) download $name-$version-i686-unknown-linux-musl ;; Darwin\ *64) download $name-$version-x86_64-apple-darwin ;; *) echo "No pre-built binary available for ${arch}."; try_build ;; esac
#!/usr/bin/env bash # Try install by # - download binary # - build with cargo set -o nounset # error when referencing undefined variable set -o errexit # exit when command fails set -o pipefail version=0.1.11 name=languageclient function try_curl() { command -v curl > /dev/null && \ curl --fail --location $1 --output bin/$name } function try_wget() { command -v wget > /dev/null && \ wget --output-document=bin/$name $1 } function download() { echo "Downloading bin/${name}..." local url=https://github.com/autozimu/LanguageClient-neovim/releases/download/$version/${1} if (try_curl $url || try_wget $url); then chmod a+x bin/$name return else echo "Failed to download with curl and wget" try_build fi } function try_build() { echo "Trying build locally ..." make release } arch=$(uname -sm) binary="" case "${arch}" in Linux\ *64) download $name-$version-x86_64-unknown-linux-musl ;; Linux\ *86) download $name-$version-i686-unknown-linux-musl ;; Darwin\ *64) download $name-$version-x86_64-apple-darwin ;; *) echo "No pre-built binary available for ${arch}."; try_build ;; esac
Fix wal-e dep on envdir
pkg_name=wal-e pkg_version=1.0.2 pkg_origin=starkandwayne pkg_maintainer="Justin Carter <justin@starkandwayne.com>" pkg_license=('wal-e license') pkg_description="Continuous Archiving for Postgres" pkg_upstream_url="https://github.com/wal-e/wal-e" pkg_source=https://github.com/wal-e/wal-e/archive/v${pkg_version}.tar.gz pkg_shasum=f3bd4171917656fef3829c9d993684d26c86eef0038ac3da7f12bae9122c6fc3 pkg_deps=(core/envdir core/python) pkg_bin_dirs=(bin) do_download() { return 0 } do_verify() { return 0 } do_unpack() { return 0 } do_prepare() { pyvenv "$pkg_prefix" # shellcheck source=/dev/null source "$pkg_prefix/bin/activate" } do_build() { return 0 } do_install() { pip install "wal-e[aws]==$pkg_version" # Write out versions of all pip packages to package pip freeze > "$pkg_prefix/requirements.txt" }
pkg_name=wal-e pkg_version=1.0.2 pkg_origin=starkandwayne pkg_maintainer="Justin Carter <justin@starkandwayne.com>" pkg_license=('wal-e license') pkg_description="Continuous Archiving for Postgres" pkg_upstream_url="https://github.com/wal-e/wal-e" pkg_source=https://github.com/wal-e/wal-e/archive/v${pkg_version}.tar.gz pkg_shasum=f3bd4171917656fef3829c9d993684d26c86eef0038ac3da7f12bae9122c6fc3 pkg_deps=(starkandwayne/envdir core/python) pkg_bin_dirs=(bin) do_download() { return 0 } do_verify() { return 0 } do_unpack() { return 0 } do_prepare() { pyvenv "$pkg_prefix" # shellcheck source=/dev/null source "$pkg_prefix/bin/activate" } do_build() { return 0 } do_install() { pip install "wal-e[aws]==$pkg_version" # Write out versions of all pip packages to package pip freeze > "$pkg_prefix/requirements.txt" }
Tidy up output of leanpreview.sh
curl -d "api_key=$LEANPUB_API_KEY" https://leanpub.com/$LEANPUB_BOOK_NAME/preview.json
echo -e "\nGenerating Preview of $LEANPUB_BOOK_NAME..\n" curl -d "api_key=$LEANPUB_API_KEY" https://leanpub.com/$LEANPUB_BOOK_NAME/preview.json echo -e "\n"
Install dependencies before running server
#!/bin/bash set -eux rm ~/.birdseye_test.db || true export BIRDSEYE_SERVER_RUNNING=true gunicorn -b 127.0.0.1:7777 birdseye.server:app & sleep 3 set +e python setup.py test result=$? kill $(ps aux | grep birdseye.server:app | grep -v grep | awk '{print $2}') exit ${result}
#!/bin/bash set -eux pip install -e . rm ~/.birdseye_test.db || true export BIRDSEYE_SERVER_RUNNING=true gunicorn -b 127.0.0.1:7777 birdseye.server:app & sleep 3 set +e python setup.py test result=$? kill $(ps aux | grep birdseye.server:app | grep -v grep | awk '{print $2}') exit ${result}
Fix bug for remote host unknown.
#!/bin/bash echo "Colecting results" mkdir -p final for remoteHost in $@; do rsync -a --progress remoteHost:~/viseem/final/ ./final/ done echo "All results were colected"
#!/bin/bash echo "Colecting results" mkdir -p final for remoteHost in $@; do rsync -a --progress $remoteHost:~/viseem/final/ ./final/ done echo "All results were colected"
Revert "Added vim to the list of packages, as it's not installed in Ubuntu 10.04 LTS by default."
#!/bin/sh # # This script installs all required modules on a Ubuntu System # This script does *NOT* install required dependancies for ptgrey module, # so do that by yourself, or configure using # $ configure --enable-all --enable-camera-ptgrey=no # to get by without it. # Add the ARToolKitPlus repo to our sources. # Copy, replace etc the file because otherwise it'll get run multipule times # And that'll append multipule repos # And that's probably bad. Better way to do this would be to check if repo's in # sources list, but that's alot of effort. Feel free to fix. cp /etc/apt/sources.list /etc/apt/sources.list.backup echo '' >> /etc/apt/sources.list echo '# ARToolKitPlus repository' >> /etc/apt/sources.list echo 'deb http://ppa.launchpad.net/michael-the-drummer/wcl/ubuntu lucid main' >> /etc/apt/sources.list apt-get update apt-get install \ build-essential \ libtool \ automake \ libxext-dev \ flex \ bison \ libraw1394-dev \ libdc1394-22-dev \ libavcodec-dev \ libavformat-dev \ libswscale-dev \ artoolkitplus-dev \ libcwiid-dev \ vim # Replace the sources.list with the backup mv /etc/apt/sources.list.backup /etc/apt/sources.list
#!/bin/sh # # This script installs all required modules on a Ubuntu System # This script does *NOT* install required dependancies for ptgrey module, # so do that by yourself, or configure using # $ configure --enable-all --enable-camera-ptgrey=no # to get by without it. # Add the ARToolKitPlus repo to our sources. # Copy, replace etc the file because otherwise it'll get run multipule times # And that'll append multipule repos # And that's probably bad. Better way to do this would be to check if repo's in # sources list, but that's alot of effort. Feel free to fix. cp /etc/apt/sources.list /etc/apt/sources.list.backup echo '' >> /etc/apt/sources.list echo '# ARToolKitPlus repository' >> /etc/apt/sources.list echo 'deb http://ppa.launchpad.net/michael-the-drummer/wcl/ubuntu lucid main' >> /etc/apt/sources.list apt-get update apt-get install \ build-essential \ libtool \ automake \ libxext-dev \ flex \ bison \ libraw1394-dev \ libdc1394-22-dev \ libavcodec-dev \ libavformat-dev \ libswscale-dev \ artoolkitplus-dev \ libcwiid-dev # Replace the sources.list with the backup mv /etc/apt/sources.list.backup /etc/apt/sources.list