code
stringlengths 2
1.05M
| repo_name
stringlengths 5
110
| path
stringlengths 3
922
| language
stringclasses 1
value | license
stringclasses 15
values | size
int64 2
1.05M
|
---|---|---|---|---|---|
#!/bin/bash
# Set up sudo
echo %ubuntu ALL=NOPASSWD:ALL > /etc/sudoers.d/ubuntu
chmod 0440 /etc/sudoers.d/ubuntu
# Setup sudo to allow no-password sudo for "sudo"
usermod -a -G sudo ubuntu
# Installing ubuntu keys
mkdir /home/ubuntu/.ssh
chmod 700 /home/ubuntu/.ssh
cd /home/ubuntu/.ssh
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
chmod 600 /home/ubuntu/.ssh/authorized_keys
chown -R ubuntu /home/ubuntu/.ssh
# Install NFS for ubuntu
apt-get update
apt-get install -y nfs-common
|
reoring/packer-ubuntu-13.04-docker
|
scripts/vagrant.sh
|
Shell
|
mit
| 554 |
#!/bin/bash
# Copyright (c) 2016 Joji Doi
# This script is only for development deploy bubble3/tmp/20160723_220500.tgz to /var/www/html/bubble3
# Run this script in bubble3/bin/
BIN_DIR=$(pwd)
WORK_DIR=$(dirname "${BIN_DIR}")
LATEST_BUILD=$(ls -t ${WORK_DIR}/tmp | head -1)
DESTINATION=/var/www/html/bubble3
cd ${DESTINATION}
rm -rf ${DESTINATION}/*
tar xvf ${WORK_DIR}/tmp/${LATEST_BUILD}
mkdir -p ${DESTINATION}/ext-content
cd $_
cp -r ${WORK_DIR}/test/* .
cd ${WORK_DIR}
echo '{"thumbs":"WIP"}' > ${DESTINATION}/data/thumb-gen.json
cp ${DESTINATION}/img/background_default.jpg ${DESTINATION}/img/background.jpg
|
do-i/bubble3
|
bin/dev-deploy.sh
|
Shell
|
mit
| 615 |
#!/bin/bash
#
# Description : Install Webdav for Apache
# Author : Jose Cerrejon Gonzalez (ulysess@gmail_dot._com)
# Version : 0.7 (14/May/14)
#
# Thks to : https://www.alvaroreig.com/como-configurar-unservidor-webdav-en-la-raspberry-pi/
# https://www.instructables.com/id/Apache-SSL-WebDav-Server/?ALLSTEPS
#
# TODO : Webdav to other web server
# With SSL certificate
#
clear
VHOST_NAME="server"
IP=$(hostname -I)
vhost_ssl(){
echo -e "\nGenerating file...\n"
FILE="
<VirtualHost *:443>\n
ServerName $VHOST_NAME\n
ErrorLog /var/log/apache2/$VHOST_NAME_error.log\n
\n
SSLEngine on\n
SSLCertificateFile /etc/ssl/cfdos/server.crt\n
SSLCertificateKeyFile /etc/ssl/cfdos/server.key\n
\n
DocumentRoot /var/www/webdav\n
\n
<Location />\n
order deny,allow\n
#Allow from 192.168.1.1/255.255.255.0 #allow access from LAN\n
#Allow from 192.168.1.8/255.255.255.255 #allow access from IP 8\n
order allow,deny\n
Allow from all\n
Deny from all\n
\n
DAV On\n
AuthType Basic\n
AuthName 'webdav'\n
AuthUserFile /var/www/passwd.dav\n
Require valid-user\n
</Location>\n
</VirtualHost>\n
"
echo -e $FILE | sudo tee -a /etc/apache2/sites-available/$VHOST_NAME
}
vhost(){
echo -e "\nGenerating file...\n"
FILE="
NameVirtualHost *\n
<VirtualHost *>\n
ServerAdmin webmaster@localhost\n
\n
DocumentRoot /var/www/webdav/\n
<Directory /var/www/webdav/>\n
Options Indexes MultiViews\n
AllowOverride None\n
Order allow,deny\n
allow from all\n
</Directory>\n
\n
Alias /webdav /var/www/webdav\n
\n
<Location /webdav>\n
DAV On\n
AuthType Basic\n
AuthName 'webdav'\n
AuthUserFile /var/www/webdav/passwd.dav\n
Require valid-user\n
</Location>\n
\n
</VirtualHost>\n
"
echo -e $FILE | sudo tee -a /etc/apache2/sites-available/default
}
webdav_ssl(){
sudo mkdir -p /etc/ssl/cfdos
sudo openssl req -config /etc/ssl/openssl.cnf -new -out /etc/ssl/cfdos/server.csr
sudo openssl rsa -in privkey.pem -out /etc/ssl/cfdos/server.key
sudo openssl x509 -in /etc/ssl/cfdos/server.csr -out /etc/ssl/cfdos/server.crt -req -signkey /etc/ssl/cfdos/server.key -days 3650
rm privkey.pem
echo -e "\nEnter directory full path you want to share:"
read WEBDAV_DIR
sudo ln -s $WEBDAV_DIR /var/www/webdav
sudo chown www-data:www-data /var/www/webdav
echo -e "\nPlease enter a new user to Webdav:"
read WEBDAV_USER
htpasswd -c /var/www/passwd.dav $WEBDAV_USER
sudo chown root:www-data /var/www/passwd.dav
sudo chmod 440 /var/www/passwd.dav
sudo a2enmod dav_fs
sudo a2enmod dav
sudo a2enmod ssl
sudo a2enmod auth_digest
echo -e "\nPlease enter a virtualhost name:"
read $VHOST_NAME
vhost_ssl
#sudo sed -i '0,/RE/s/.*NameVirtualHost.*/&\nNameVirtualHost *:443/' /etc/apache2/ports.conf
sudo a2ensite $VHOST_NAME
service apache2 restart
read -p "Done!. Now you can enter https://$IP/$VHOST_NAME and check if works. TIP: Change the location as root of /var/www/passwd.dav and modify /etc/apache2/sites-availaible/$VHOST_NAME. Press [ENTER]..."
}
echo -e "Installing Webdav for Apache\n============================\n\n· Allow you to share a directory from Apache with/outh SSL certification.\n· TIP: When ask PEM pass phrase, type a password (4-10 characters).\n Make sure you know the path directory you want to share.\n"
read -p "Press [ENTER] to continue..."
sudo a2enmod dav_fs
sudo a2enmod auth_digest
echo -e "\nEnter directory full path you want to share:"
read WEBDAV_DIR
sudo ln -s $WEBDAV_DIR /var/www/webdav
sudo chown www-data:www-data /var/www/webdav
echo -e "\nPlease enter a new user to Webdav:"
read WEBDAV_USER
htpasswd -c /var/www/passwd.dav $WEBDAV_USER
sudo chown root:www-data /var/www/passwd.dav
sudo chmod 440 /var/www/passwd.dav
vhost
sudo /etc/init.d/apache2 reload
read -p "Done!. Now you can enter https://$IP/webdav and check if works. Press [ENTER] to continue..."
|
jmcerrejon/PiKISS
|
scripts/server/webdav.sh
|
Shell
|
mit
| 4,445 |
#!/usr/bin/env bash
#!/usr/bin/env bash
set -e
mkimg="$(basename "$0")"
usage() {
echo >&2 "usage: $mkimg [-d dir] [-t tag] [--compression algo| --no-compression] mkimage-arch repo_date"
echo >&2 " ie: $mkimg mkimage-arch 2016/04/05"
exit 1
}
scriptDir="$(dirname "$(readlink -f "$BASH_SOURCE")")/mkimage"
optTemp=$(getopt --options '+d:t:c:hC' --longoptions 'dir:,tag:,compression:,no-compression,help' --name "$mkimg" -- "$@")
eval set -- "$optTemp"
unset optTemp
dir="$(mktemp -d ${TMPDIR:-/var/tmp}/docker-mkimage.XXXXXXXXXX)"
tag=
compression="auto"
while true; do
case "$1" in
-d|--dir) dir="$2" ; shift 2 ;;
-t|--tag) tag="$2" ; shift 2 ;;
--compression) compression="$2" ; shift 2 ;;
--no-compression) compression="none" ; shift 1 ;;
-h|--help) usage ;;
--) shift ; break ;;
esac
done
script="$1"
[ "$script" ] || usage
shift
echo $@ | grep -q . || {
echo "Must supply repo date"
exit 1
}
if [ "$compression" == 'auto' ] || [ -z "$compression" ]
then
compression='xz'
fi
[ "$compression" == 'none' ] && compression=''
if [ ! -x "$scriptDir/$script" ]; then
echo >&2 "error: $script does not exist or is not executable"
echo >&2 " see $scriptDir for possible scripts"
exit 1
fi
# don't mistake common scripts like .febootstrap-minimize as image-creators
if [[ "$script" == .* ]]; then
echo >&2 "error: $script is a script helper, not a script"
echo >&2 " see $scriptDir for possible scripts"
exit 1
fi
delDir=
if [ -z "$dir" ]; then
dir="$(mktemp -d ${TMPDIR:-/var/tmp}/docker-mkimage.XXXXXXXXXX)"
delDir=1
fi
rootfsDir="$dir/rootfs"
( set -x; mkdir -p "$rootfsDir" )
# pass all remaining arguments to $script
"$scriptDir/$script" "$rootfsDir" "$@"
# Docker mounts tmpfs at /dev and procfs at /proc so we can remove them
rm -rf "$rootfsDir/dev" "$rootfsDir/proc"
mkdir -p "$rootfsDir/dev" "$rootfsDir/proc"
# make sure /etc/resolv.conf has something useful in it
mkdir -p "$rootfsDir/etc"
cat > "$rootfsDir/etc/resolv.conf" <<'EOF'
nameserver 8.8.8.8
nameserver 8.8.4.4
EOF
tarFile="$dir/rootfs.tar${compression:+.$compression}"
touch "$tarFile"
(
set -x
docker run -t -i --rm archlinux /bin/bash
)
echo >&2 "+ cat > '$dir/Dockerfile'"
cat > "$dir/Dockerfile" <<EOF
FROM scratch
ADD $(basename "$tarFile") /
EOF
# if our generated image has a decent shell, let's set a default command
for shell in /bin/bash /usr/bin/fish /usr/bin/zsh /bin/sh; do
if [ -x "$rootfsDir/$shell" ]; then
( set -x; echo 'CMD ["'"$shell"'"]' >> "$dir/Dockerfile" )
break
fi
done
( set -x; rm -rf "$rootfsDir" )
if [ "$tag" ]; then
( set -x; docker build -t "$tag" "$dir" )
elif [ "$delDir" ]; then
# if we didn't specify a tag and we're going to delete our dir, let's just build an untagged image so that we did _something_
( set -x; docker build "$dir" )
fi
if [ "$delDir" ]; then
( set -x; rm -rf "$dir" )
fi
|
imriss/rarchlinux
|
runimage.sh
|
Shell
|
mit
| 2,877 |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for RHSA-2010:0861
#
# Security announcement date: 2010-11-10 19:31:57 UTC
# Script generation date: 2017-01-25 21:19:53 UTC
#
# Operating System: Red Hat 6
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - xulrunner.i686:1.9.2.12-1.el6_0
# - xulrunner-debuginfo.i686:1.9.2.12-1.el6_0
# - firefox.x86_64:3.6.12-1.el6_0
# - firefox-debuginfo.x86_64:3.6.12-1.el6_0
# - xulrunner.x86_64:1.9.2.12-1.el6_0
# - xulrunner-debuginfo.x86_64:1.9.2.12-1.el6_0
# - xulrunner-devel.i686:1.9.2.12-1.el6_0
# - xulrunner-devel.x86_64:1.9.2.12-1.el6_0
#
# Last versions recommanded by security team:
# - xulrunner.i686:17.0.10-1.el6_4
# - xulrunner-debuginfo.i686:17.0.10-1.el6_4
# - firefox.x86_64:45.7.0-1.el6_8
# - firefox-debuginfo.x86_64:45.7.0-1.el6_8
# - xulrunner.x86_64:17.0.10-1.el6_4
# - xulrunner-debuginfo.x86_64:17.0.10-1.el6_4
# - xulrunner-devel.i686:17.0.10-1.el6_4
# - xulrunner-devel.x86_64:17.0.10-1.el6_4
#
# CVE List:
# - CVE-2010-3175
# - CVE-2010-3176
# - CVE-2010-3177
# - CVE-2010-3178
# - CVE-2010-3179
# - CVE-2010-3180
# - CVE-2010-3182
# - CVE-2010-3183
# - CVE-2010-3765
#
# More details:
# - https://www.cyberwatch.fr/vulnerabilites
#
# Licence: Released under The MIT License (MIT), See LICENSE FILE
sudo yum install xulrunner.i686-17.0.10 -y
sudo yum install xulrunner-debuginfo.i686-17.0.10 -y
sudo yum install firefox.x86_64-45.7.0 -y
sudo yum install firefox-debuginfo.x86_64-45.7.0 -y
sudo yum install xulrunner.x86_64-17.0.10 -y
sudo yum install xulrunner-debuginfo.x86_64-17.0.10 -y
sudo yum install xulrunner-devel.i686-17.0.10 -y
sudo yum install xulrunner-devel.x86_64-17.0.10 -y
|
Cyberwatch/cbw-security-fixes
|
Red_Hat_6/x86_64/2010/RHSA-2010:0861.sh
|
Shell
|
mit
| 1,738 |
#!/usr/local/bin/bash
python manage.py celery events --camera=djcelery.snapshot.Camera
|
oca159/cookiecutter-django
|
{{cookiecutter.project_slug}}/camera.sh
|
Shell
|
mit
| 86 |
#!/bin/bash
th model-1_layer.lua -data '../toy/variable_width_2-4-200k.t7' -hidden 16 \
-batch 16 -rate 0.15 -iter 5 -trained 'trained_model-1_layer-200k' \
-grid 'grid_predictions-1_layer-200k' \
| tee model-1_layer-200k.out
|
kbullaughey/lstm-play
|
toys/lstm/model-1_layer-200k.sh
|
Shell
|
mit
| 237 |
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2016 Robert Painsi
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
_ROOT_=$(pwd);
function printPrompt() {
echo -e $($_ROOT_/../../promptig) | sed -e 's#\\w#~/promptig/test#g' | sed -e 's/\\\[//g' | sed -e 's/\\\]//g'
}
|
robertpainsi/promptig
|
test/tests/testcase.sh
|
Shell
|
mit
| 1,286 |
#!/bin/sh
echo "Deploy demos and docs to github pages.";
mkdir gh_pages;
cp -r demo gh_pages/;
cp -r dist gh_pages/;
cp -r docs gh_pages/;
mkdir -p gh_pages/plugins/webrtc;
cp -r plugins/webrtc/dist gh_pages/plugins/webrtc/;
cp -r plugins/webrtc/docs gh_pages/plugins/webrtc/;
mkdir -p gh_pages/plugins/groupchat-receipts;
cp -r plugins/groupchat-receipts/dist gh_pages/plugins/groupchat-receipts/;
cp -r plugins/groupchat-receipts/docs gh_pages/plugins/groupchat-receipts/;
mkdir -p gh_pages/plugins/typed-messages;
cp -r plugins/typed-messages/dist gh_pages/plugins/typed-messages/;
cp -r plugins/typed-messages/docs gh_pages/plugins/typed-messages/;
mkdir -p gh_pages/plugins/live-query;
cp -r plugins/live-query/dist gh_pages/plugins/live-query/;
cp -r plugins/live-query/docs gh_pages/plugins/live-query/;
cd gh_pages && git init;
git config user.name "leancloud-bot";
git config user.email "[email protected]";
git add .;
git commit -m "Deploy demos to Github Pages [skip ci]";
git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git master:gh-pages > /dev/null 2>&1;
echo "done.";
cd ..
|
leancloud/js-realtime-sdk
|
script/deploy.sh
|
Shell
|
mit
| 1,101 |
#!/usr/bin/env zsh
setopt shwordsplit
SHUNIT_PARENT=$0
source ../zit.zsh
oneTimeSetUp() {
ZIT_MODULES_PATH=$(mktemp -d)
}
oneTimeTearDown() {
rm -rf "${ZIT_MODULES_PATH}"
}
test_zit_in_zit_lo() {
assertTrue "zit-in 'https://github.com/junegunn/fzf' 'fzf'"
assertTrue "zit-lo 'fzf' 'shell/completion.zsh'"
assertTrue "zit-lo 'fzf' 'shell/key-bindings.zsh'"
}
test_zit_in_zit_lo_compat_with_other_shells() {
assertTrue "zit-in 'https://github.com/kennethreitz/autoenv' 'autoenv'"
assertTrue "emulate sh -c \"zit-load 'autoenv' 'activate.sh'\" "
}
test_zit_in_script_path() {
assertTrue "zit-in 'https://github.com/clvv/fasd' 'fasd'"
export PATH="${ZIT_MODULES_PATH}/fasd:${PATH}"
assertTrue "fasd"
}
test_zit_in_zit_lo_with_branch() {
assertTrue "zit-in 'https://github.com/Eriner/zim#zsh-5.0' 'zim'"
assertTrue "zit-lo 'zim' 'modules/directory/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/environment/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/git/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/git-info/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/history/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/utility/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/ssh/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/syntax-highlighting/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/history-substring-search/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/prompt/init.zsh'"
assertTrue "zit-lo 'zim' 'modules/completion/init.zsh'"
}
test_zit_il() {
assertTrue "zit-il 'https://github.com/sorin-ionescu/prezto#stashes' 'prezto' 'init.zsh'"
}
test_zit_il_with_branch() {
assertTrue "zit-il 'https://github.com/zsh-users/zsh-autosuggestions#develop' \
'zsh-autosuggestions' 'zsh-autosuggestions.zsh'"
}
test_zit_up() {
assertTrue "zit-up"
}
test_zit_rm() {
# Needs to run without assert to export env variables to the sub-shells
zit-in 'https://github.com/thiagokokada/zit' 'zit' &>/dev/null
assertTrue "yes y | zit-rm 'zit'"
assertTrue "[[ ! -d \"${ZIT_MODULES_PATH}/zit\" ]]"
}
source ./shunit2/src/shunit2
|
m45t3r/zit
|
tests/test_zit_integration.zsh
|
Shell
|
mit
| 2,063 |
# The MIT License (MIT)
#
# Copyright (c) 2015 dinowernli
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# An example execution for the raytracer.
./build/raytracer --scene_data=data/scene/lights.sd -gui --logtostderr --image_resolution_x=1300 --image_resolution_y=1300 -root_rays_per_pixel=9
|
dinowernli/raytracer
|
example.sh
|
Shell
|
mit
| 1,304 |
if [ -d $HOME/Applications ]; then
export VIM_APP_DIR=$HOME/Applications
fi
|
cunningham/dotfiles
|
archive/osx/env.zsh
|
Shell
|
mit
| 79 |
# Functions for zsh
# #########
# Some example functions
# function settitle() { echo -ne "\e]2;$@\a\e]1;$@\a"; }
function build() { flex -Cf scanner.l; gcc -Wall -O -mno-cygwin -o $1 scanner.c; }
function debugflex() { flex -d scanner.l; gcc -mno-cygwin -o $1 scanner.c; }
function debugc() { flex scanner.l; gcc -g -Wall -mno-cygwin -o $1 scanner.c; }
# use ctrl l to clear screen
netinfo ()
{
echo "--------------- Network Information ---------------"
ifconfig | awk /'inet addr/ {print $2}'
ifconfig | awk /'Bcast/ {print $3}'
ifconfig | awk /'inet addr/ {print $4}'
ifconfig | awk /'HWaddr/ {print $4,$5}'
echo "---------------------------------------------------"
}
function include_d {
dir=$1
if [ -d $HOME/.$dir.d -a -r $HOME/.$dir.d -a -x $HOME/.$dir.d ]; then
for i in $HOME/.$dir.d/*.sh; do
source $i
done
fi
}
function runTest() {
local CWD=$PWD
while true; do
if [ -d node_modules ]; then
break
fi
if [ $PWD == '/' ]; then
echo "Could not find node_modules directory!"
break
fi
cd ..
done
./node_modules/mocha/bin/mocha --ui exports --reporter spec --recursive $1
cd $CWD
}
#include_d bash_functions
#include_d bash_aliases
#include_d bash_completion
|
srathbun/oh-my-zsh
|
custom/functions.zsh
|
Shell
|
mit
| 1,204 |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for DSA-3520-1
#
# Security announcement date: 2016-03-18 00:00:00 UTC
# Script generation date: 2017-01-01 21:07:54 UTC
#
# Operating System: Debian 7 (Wheezy)
# Architecture: armv7l
#
# Vulnerable packages fix on version:
# - icedove:38.7.0-1~deb7u1
#
# Last versions recommanded by security team:
# - icedove:45.4.0-1~deb7u1
#
# CVE List:
# - CVE-2016-1950
# - CVE-2016-1954
# - CVE-2016-1957
# - CVE-2016-1960
# - CVE-2016-1961
# - CVE-2016-1962
# - CVE-2016-1964
# - CVE-2016-1966
# - CVE-2016-1974
# - CVE-2016-1977
# - CVE-2016-2790
# - CVE-2016-2791
# - CVE-2016-2792
# - CVE-2016-2793
# - CVE-2016-2794
# - CVE-2016-2795
# - CVE-2016-2796
# - CVE-2016-2797
# - CVE-2016-2798
# - CVE-2016-2799
# - CVE-2016-2800
# - CVE-2016-2801
# - CVE-2016-2802
#
# More details:
# - https://www.cyberwatch.fr/vulnerabilites
#
# Licence: Released under The MIT License (MIT), See LICENSE FILE
sudo apt-get install --only-upgrade icedove=45.4.0-1~deb7u1 -y
|
Cyberwatch/cbw-security-fixes
|
Debian_7_(Wheezy)/armv7l/2016/DSA-3520-1.sh
|
Shell
|
mit
| 1,057 |
#!/bin/sh
#
# Copyright (c) 2009 Andreas Liebschner
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MPLAYER="/usr/bin/mplayer"
LAME="/usr/bin/lame"
# You can change these options, but don't remove --add-id3v2
LAMEOPTS="-V 0 --vbr-new -b 256 --lowpass 15.5 -q 0 --add-id3v2"
CWD=$(pwd)
convert() {
for FILE in *.m4a; do
NAME=$(basename "$FILE" .m4a)
$MPLAYER -vc null -vo null -ao pcm:fast:file="$NAME.wav" "$FILE"
$LAME $LAMEOPTS "$NAME.wav" "$NAME.mp3"
$CWD/addtags.py "$FILE" "$NAME.mp3"
done
}
cleanup() {
find . -type f -name "*.wav" -delete
}
if [ -d "$1" ]; then
cd "$1"
convert
cleanup
else
echo " Hey Einstein, what about passing me an existing directory as an "
echo " argument? Hint: it has to contain some m4a file to convert."
echo " "
fi
|
lbsnrs/m4atomp3
|
m4atomp3.sh
|
Shell
|
mit
| 1,818 |
#!/usr/bin/env bash
if [ -f ./README.md ] && [ -f ./LICENSE ];
then
echo "Removing old gem.."
gem uninstall -x barnyard2waldo
echo "Building gem.."
gem build barnyard2waldo.gemspec
echo "Installing gem.."
gem install barnyard2waldo-`bump current |grep -o [0-9].*`.gem
git status
echo "Validating gem.."
gem list --local |grep barnyard2waldo
else
echo "not in root gem directory, existing."
fi
|
shadowbq/barnyard2-waldo
|
build-gem.sh
|
Shell
|
mit
| 405 |
#!/bin/bash
# This is a pipeline for mapping exons onto transcripts and taking intersection of overlapping exons
n_threads=6
best_alignment=True
e_val=1e-10
word_size=9
match_score=1
mismatch_score=-1
gapopen=2
gapextend=1
data_path='../sample'
echo 'FORMATTING DATABASE'
# Format database, i.e. file with gene models generated with 'make_gene_model_from_exons.py'
formatdb -pF -i gene_model.fasta
echo 'MAPPING EXONS TO REFERENCE'
# Map exons onto transcripts using distant megablast parameters
python map_seq_on_exons_by_blast.py -r $data_path/gene_model.fasta -g $data_path/gene_model.gff3 -q $data_path/transcripts_sample.fasta -b $data_path/gene_model.fasta -f output_file -e $e_val -a $best_alignment -w $word_size -n $n_threads -r $match_score -s $mismatch_score -y $gapopen -x $gapextend
# The output file 'exons_alignment_by_blast_out_global.gff3' contains information about coordinates of model exons on transcripts.
echo 'TAKING INTERSECTION OF THE OVERLAPING EXONS'
# Take intersection of overlapping exons (e.g. two overlapping exons will be split into three non-overlapping regions)
python exon_mip_intersection.py exons_alignment_by_blast_out_global.gff3
# The output file, exon_mip_intersection.out is a table containing three columns: reference transcript name, exon start position, exon stop position
|
molecol/targeted-resequencing-with-mips
|
exon_boundaries_on_transcript/find_exons.sh
|
Shell
|
mit
| 1,329 |
#!/usr/bin/sh
sudo app/console cache:clear
sudo chown apache:apache -R app/cache
sudo chown apache:apache -R app/logs
sudo chmod -R 771 app/cache
sudo chmod -R 771 app/logs
|
Raffaello/symfony2-example
|
cache.sh
|
Shell
|
mit
| 173 |
# shellcheck shell=bash
function __dotfiles_exports_gnu_utils() {
if ! is-command brew; then
return
fi
local -r coreutils_base_path="$(get-brew-prefix-path coreutils)/libexec"
local -r sed_base_path="$(get-brew-prefix-path gnu-sed)/libexec"
# Update `$PATH`.
prepend-to-path "$sed_base_path/gnubin"
prepend-to-path "$coreutils_base_path/gnubin"
# Update `$MANPATH`
prepend-to-manpath "$sed_base_path/gnuman"
prepend-to-manpath "$coreutils_base_path/gnuman"
}
__dotfiles_exports_gnu_utils
|
wesm87/dotfiles
|
exports/gnu-utils.sh
|
Shell
|
mit
| 517 |
#!/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.
#
set -e
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
REPOROOT="$( cd -P "$DIR/../.." && pwd )"
source "$DIR/../_common.sh"
rm "$REPOROOT/test/TestApp/project.lock.json"
dotnet restore "$REPOROOT/test/TestApp" --runtime "osx.10.10-x64" --runtime "ubuntu.14.04-x64" --runtime "win7-x64"
dotnet compile "$REPOROOT/test/TestApp" --output "$REPOROOT/artifacts/$RID/smoketest"
# set -e will abort if the exit code of this is non-zero
$REPOROOT/artifacts/$RID/smoketest/TestApp
# Check that a compiler error is reported
set +e
dotnet compile "$REPOROOT/test/compile/failing/SimpleCompilerError" --framework "$TFM" 2>/dev/null >/dev/null
rc=$?
if [ $rc == 0 ]; then
error "Compiler failure test failed! The compiler did not fail to compile!"
exit 1
fi
set -e
|
piotrpMSFT/cli-old
|
scripts/test/smoke-test.sh
|
Shell
|
mit
| 1,325 |
#!/bin/bash
apt-get update --yes
apt-get install --yes \
bmon \
build-essential \
colordiff \
colorgcc \
colormake \
colortail \
curl \
fish \
git-all \
git-cola \
git-extras \
git-gui \
git2cl \
gitk \
gitstats \
mercurial \
screen \
subversion \
svn2cl \
tcpdump \
tcpstat \
tmux \
tshark \
wget
|
peter4strom/devbox
|
install_base.sh
|
Shell
|
mit
| 324 |
gcc -c -fpic -O2 ring_libcurl.c -I $PWD/../../language/include
gcc -shared -o $PWD/../../lib/libring_libcurl.so ring_libcurl.o -L $PWD/../../lib -lring -L /usr/lib/i386-linux-gnu -lcurl -lssl -lcrypto
|
ring-lang/ring
|
extensions/ringcurl/buildgcc.sh
|
Shell
|
mit
| 206 |
#!/usr/bin/env bash
set -e
distro=$(uname)
function msg_status () {
echo -e "\x1B[01;34m[*]\x1B[0m $1"
}
function msg_good () {
echo -e "\x1B[01;32m[*]\x1B[0m $1"
}
function msg_error () {
echo -e "\x1B[01;31m[*]\x1B[0m $1"
}
function msg_notification () {
echo -e "\x1B[01;33m[*]\x1B[0m $1"
}
msg_status "let's (auto) basejump!"
os-check(){
msg_notification "checking operating system"
if [ "$distro" == "Linux" ]; then
msg_good "$distro is supported, continuing"
elif [ "$distro" == "MacOS" ]; then
msg_good "$distro is supported, continuing"
fi
}
install-xcode(){
if ! command -v cc >/dev/null; then
msg_notification "xcode commandline tools not installed, installing"
xcode-select --install
fi
msg_good "xcode commandline tools installed"
}
software-check(){
msg_notification "checking for required software"
for cli in curl python pip git sudo; do
if ! type "$cli" > /dev/null 2>&1; then
msg_error "$cli is not installed - install that and try again"; exit 1
fi
done
msg_good "all required software installed"
}
get-basejump(){
msg_notification "checking out basejump-master"
if [ ! -d '$HOME/devel' ]; then
msg_notification "creating checkout directory"
mkdir -p $HOME/devel
fi
if [ -d '$HOME/devel/basejump-master' ]; then
rm -rf $HOME/devel/basejump-master
cd $HOME/devel; curl -sL https://github.com/philcryer/basejump/archive/master.tar.gz | tar xz
else
cd $HOME/devel; curl -sL https://github.com/philcryer/basejump/archive/master.tar.gz | tar xz
fi
msg_good "basejump-master downloaded"
}
main(){
os-check;
if [ "$distro" == "MacOS" ]; then
install-xcode;
fi
software-check;
get-basejump;
msg_status ">> Next steps >>"
msg_status "* run"
msg_status " cd $HOME/devel/basejump-master"
msg_status "* edit gitconfig vars in ansible/group_vars/all.yml"
msg_status "* run basejump!"
msg_status " ./basejump"
}
main;
exit 0
|
philcryer/basejump
|
src/no-git.sh
|
Shell
|
mit
| 2,085 |
#!/bin/sh
set -e
. ./common.sh
sudo date > /dev/null
sec "Configuring disk image for the cloud"
msg "Checking that we have Arch's install scripts"
pacman -Qi arch-install-scripts >/dev/null || sudo pacman -S arch-install-scripts # for genfstab and arch-chroot
cp bootstrapped.raw archlinux.raw.tmp
tmp=$(mktemp -d -t arch-cloud-build.XXXXXXXXXX)
tmp=$(readlink -f "$tmp")
./mount.sh "archlinux.raw.tmp" "$tmp"
if [ ! -e ".mountpoint" ]; then
exit 1
fi
lodev=$(cat .mountpoint)
msg "Generating /etc/fstab for $tmp"
uuid=$(sudo blkid -o value "/dev/mapper/${lodev}p1" | head -n1)
echo "UUID=$uuid / ext4 rw,relatime,data=ordered 0 1" | sudo tee -a "$tmp/etc/fstab"
msg "Setting up bootloader"
sudo mkdir -p "$tmp/boot/syslinux"
sudo cp -r "$tmp/usr/lib/syslinux/bios"/*.c32 "$tmp/boot/syslinux/"
sudo extlinux --install "$tmp/boot/syslinux"
sudo sed -i "1i \\SERIAL 0 115200" "$tmp/boot/syslinux/syslinux.cfg"
sudo sed -i "s@DEFAULT arch@DEFAULT archfallback@" "$tmp/boot/syslinux/syslinux.cfg"
sudo sed -i "s@TIMEOUT 50@TIMEOUT 5@" "$tmp/boot/syslinux/syslinux.cfg"
sudo sed -i "s@PROMPT 0@PROMPT 1@" "$tmp/boot/syslinux/syslinux.cfg"
sudo sed -i "s@^UI @# UI @" "$tmp/boot/syslinux/syslinux.cfg"
sudo sed -i "s@root=/dev/sda3@root=UUID=$uuid console=tty0 console=ttyS0,115200n8@" "$tmp/boot/syslinux/syslinux.cfg"
msg2 "Writing MBR"
sudo dd conv=notrunc bs=440 count=1 "if=$tmp/usr/lib/syslinux/bios/mbr.bin" "of=/dev/${lodev}"
msg "Enabling [multilib]"
sudo sed -i '/#\[multilib\]/,+1s/^#//' "$tmp/etc/pacman.conf"
sudo arch-chroot "$tmp" pacman -Sy
msg "Configuring cloud-init"
# Set up main user
msg2 "Configuring default user"
sudo sed -i "s@distro: ubuntu@distro: arch@" "$tmp/etc/cloud/cloud.cfg"
sudo sed -i "s@name: ubuntu@name: arch@" "$tmp/etc/cloud/cloud.cfg"
sudo sed -i "s@gecos: Ubuntu@gecos: Arch@" "$tmp/etc/cloud/cloud.cfg"
sudo sed -i "s@groups: .*@groups: [adm, wheel]@" "$tmp/etc/cloud/cloud.cfg"
sudo sed -i "/sudo:/d" "$tmp/etc/cloud/cloud.cfg"
sudo sed -i '/# %wheel ALL=(ALL) NOPASSWD: ALL/s/^# //' "$tmp/etc/sudoers"
# Set up data sources
msg2 "Setting up data sources"
sudo sed -i "/Example datasource config/i \\datasource_list: [ NoCloud, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, Ec2, CloudStack, None ]" "$tmp/etc/cloud/cloud.cfg"
# Avoid errors about syslog not existing
# See https://bugs.launchpad.net/cloud-init/+bug/1172983
msg2 "Fixing syslog permissions"
sudo sed -i "/datasource_list/i \\syslog_fix_perms: null" "$tmp/etc/cloud/cloud.cfg"
# Don't start Ubuntu things
msg2 "Disabling unused modules"
sudo sed -i '/emit_upstart/d' "$tmp/etc/cloud/cloud.cfg"
sudo sed -i '/ubuntu-init-switch/d' "$tmp/etc/cloud/cloud.cfg"
sudo sed -i '/grub-dpkg/d' "$tmp/etc/cloud/cloud.cfg"
sudo sed -i '/apt-pipelining/d' "$tmp/etc/cloud/cloud.cfg"
sudo sed -i '/apt-configure/d' "$tmp/etc/cloud/cloud.cfg"
sudo sed -i '/byobu/d' "$tmp/etc/cloud/cloud.cfg"
# Set up network
msg "Configuring network"
echo '[Match]
Name=e*
[Network]
DHCP=ipv4
[DHCPv4]
UseHostname=false' | sudo tee "$tmp/etc/systemd/network/dhcp-all.network"
sudo arch-chroot "$tmp" systemctl enable systemd-networkd.service
sudo arch-chroot "$tmp" systemctl enable systemd-resolved.service
sudo ln -sfn /run/systemd/resolve/resolv.conf "$tmp/etc/resolv.conf"
sudo sed -i 's/network.target/network-online.target/' "$tmp/usr/lib/systemd/system/cloud-init.service"
# Start daemons on boot
msg "Enabling system services"
sudo arch-chroot "$tmp" systemctl enable sshd
sudo arch-chroot "$tmp" systemctl enable cloud-init
sudo arch-chroot "$tmp" systemctl enable cloud-config
sudo arch-chroot "$tmp" systemctl enable cloud-final
# Remove machine ID so it is regenerated on boot
msg "Wiping machine ID"
printf "" | sudo tee "$tmp/etc/machine-id"
printf "" | sudo tee "$tmp/var/lib/dbus/machine-id"
msg "Writing motd"
# We don't want to use the pacman keys in the image, because the private
# component is effectively public (anyone with the image can find out what it
# is). Unfortunately, there is no easy way to run the necessary commands on
# (only) the next boot as far as I'm aware. Instead, we put it in the motd so
# that any user will see it the first time they log into the machine.
# For future reference, the private key can be checked with
#
# sudo gpg --homedir /etc/pacman.d/gnupg -K
#
echo "Welcome to your brand new Arch cloud instance!
Before doing anything else, you should re-key pacman with
# pacman-key --init
# pacman-key --populate archlinux
You might also want to update the system using
# pacman -Syu
(you can change this message by editing /etc/motd)" | sudo tee -a "$tmp/etc/motd"
./unmount.sh "$tmp"
mv archlinux.raw.tmp archlinux.raw
|
tchajed/cloud-arch
|
build.sh
|
Shell
|
mit
| 4,715 |
#!/bin/sh
#
# exclude annoying dirs and files on grep
#
# Author: Yanan Zhao
# Date : 2017-01-07 17:18:48
grep -R --color=always --exclude=tags --exclude-dir=tests \
--exclude-dir=datapath-windows \
--exclude-dir=ovn \
--exclude-dir=xenserver \
"$@"
|
ArthurChiao/code-snippets
|
shell/utils/grep.sh
|
Shell
|
mit
| 268 |
#!/usr/bin/env bash
./../rancher-compose --project-name blinkbox \
--url http://192.168.99.100:8080/v1/projects/1a5 \
--access-key FFBB37C775D24D87565E \
--secret-key XBXMKyKwa7FE9ugmJg1nN2WBV39M3awtRQ5M8o2T \
-f docker-compose.yml \
--verbose up \
-d --force-upgrade \
--confirm-upgrade
|
UNArqui17i-B/deployment
|
general/deploy.sh
|
Shell
|
mit
| 317 |
#!/bin/bash
rm -fr deploy
mkdir -p deploy/mac_os_scripts
cp -frv run_*.sh deploy/
cp -frv include.sh deploy/
cp -frv mac_os_scripts/*.py deploy/mac_os_scripts
cp -frv mac_os_scripts/external deploy/mac_os_scripts/
|
initialed85/mac_os_scripts
|
build.sh
|
Shell
|
mit
| 219 |
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
#sudo scutil --set ComputerName "0x6D746873"
#sudo scutil --set HostName "0x6D746873"
#sudo scutil --set LocalHostName "0x6D746873"
#sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "0x6D746873"
# Disable the sound effects on boot
# sudo nvram SystemAudioVolume=" "
# Disable transparency in the menu bar and elsewhere on Yosemite
# defaults write com.apple.universalaccess reduceTransparency -bool true
# Set highlight color to green
# defaults write NSGlobalDomain AppleHighlightColor -string "0.764700 0.976500 0.568600"
# Set sidebar icon size to medium
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2
# Show scrollbars
defaults write NSGlobalDomain AppleShowScrollBars -string "WhenScrolling"
# Possible values: `WhenScrolling`, `Automatic` and `Always`
# Disable the over-the-top focus ring animation
# defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false
# Disable smooth scrolling
# (Uncomment if you’re on an older Mac that messes up the animation)
defaults write NSGlobalDomain NSScrollAnimationEnabled -bool false
# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
# Display ASCII control characters using caret notation in standard text views
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
# defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
# Disable Resume system-wide
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
# Disable automatic termination of inactive apps
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
# Disable the crash reporter
#defaults write com.apple.CrashReporter DialogType -string "none"
# Set Help Viewer windows to non-floating mode
defaults write com.apple.helpviewer DevMode -bool true
# Fix for the ancient UTF-8 bug in QuickLook (https://mths.be/bbo)
# Commented out, as this is known to cause problems in various Adobe apps :(
# See https://github.com/mathiasbynens/dotfiles/issues/237
#echo "0x08000100:0" > ~/.CFUserTextEncoding
# Reveal IP address, hostname, OS version, etc. when clicking the clock
# in the login window
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Disable Notification Center and remove the menu bar icon
# launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
# Disable automatic capitalization as it’s annoying when typing code
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
# Disable smart dashes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Disable automatic period substitution as it’s annoying when typing code
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
# Disable smart quotes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Set a custom wallpaper image. `DefaultDesktop.jpg` is already a symlink, and
# all wallpapers are in `/Library/Desktop Pictures/`. The default is `Wave.jpg`.
#rm -rf ~/Library/Application Support/Dock/desktoppicture.db
#sudo rm -rf /System/Library/CoreServices/DefaultDesktop.jpg
#sudo ln -s /path/to/your/image /System/Library/CoreServices/DefaultDesktop.jpg
###############################################################################
# Trackpad, mouse, keyboard, Bluetooth accessories, and input #
###############################################################################
# Trackpad: enable tap to click for this user and for the login screen
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
# defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Trackpad: map bottom right corner to right-click
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
# defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
# defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
# Disable force click lookup
defaults write NSGlobalDomain com.apple.trackpad.forceClick -bool false
# Disable “natural” (Lion-style) scrolling
# defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Increase sound quality for Bluetooth headphones/headsets
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Use scroll gesture with the Ctrl (^) modifier key to zoom
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 20
# Set language and text formats
# Note: if you’re in the US, replace `EUR` with `USD`, `Centimeters` with
# `Inches`, `en_GB` with `en_US`, and `true` with `false`.
# defaults write NSGlobalDomain AppleLanguages -array "en"
# defaults write NSGlobalDomain AppleLocale -string "en_US@currency=USD"
# defaults write NSGlobalDomain AppleMeasurementUnits -string "Inches"
# defaults write NSGlobalDomain AppleMetricUnits -bool false
# Show language menu in the top right corner of the boot screen
sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
# Set the timezone; see `sudo systemsetup -listtimezones` for other values
sudo systemsetup -settimezone "America/Los_Angeles" > /dev/null
# Stop iTunes from responding to the keyboard media keys
#launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist 2> /dev/null
###############################################################################
# Energy saving #
###############################################################################
# Enable lid wakeup
sudo pmset -a lidwake 1
# Restart automatically on power loss
sudo pmset -a autorestart 1
# Restart automatically if the computer freezes
sudo systemsetup -setrestartfreeze on
# Sleep the display after 15 minutes
sudo pmset -a displaysleep 15
# Disable machine sleep while charging
# sudo pmset -c sleep 0
# Set machine sleep to 5 minutes on battery
# sudo pmset -b sleep 5
# Set standby delay to 24 hours (default is 1 hour)
# sudo pmset -a standbydelay 86400
# Never go into computer sleep mode
# sudo systemsetup -setcomputersleep Off > /dev/null
# Hibernation mode
# 0: Disable hibernation (speeds up entering sleep mode)
# 3: Copy RAM to disk so the system state can still be restored in case of a
# power failure.
sudo pmset -a hibernatemode 0
# # Remove the sleep image file to save disk space
# sudo rm /private/var/vm/sleepimage
# # Create a zero-byte file instead…
# sudo touch /private/var/vm/sleepimage
# # …and make sure it can’t be rewritten
# sudo chflags uchg /private/var/vm/sleepimage
###############################################################################
# Screen #
###############################################################################
# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Save screenshots to the desktop
defaults write com.apple.screencapture location -string "${HOME}/Desktop"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Enable subpixel font rendering on non-Apple LCDs
# Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
defaults write NSGlobalDomain AppleFontSmoothing -int 1
# Enable HiDPI display modes (requires restart)
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
###############################################################################
# Finder #
###############################################################################
# Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
defaults write com.apple.finder QuitMenuItem -bool true
# Finder: disable window animations and Get Info animations
# defaults write com.apple.finder DisableAllAnimations -bool true
# Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfDe"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Finder: show hidden files by default
#defaults write com.apple.finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: spawn tab or window when opening a new folder
defaults write com.apple.finder FinderSpawnTab -bool false
# Display full POSIX path as Finder window title
# defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Enable spring loading for directories
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
# Remove the spring loading delay for directories
defaults write NSGlobalDomain com.apple.springing.delay -float 0
# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Disable disk image verification
# defaults write com.apple.frameworks.diskimages skip-verify -bool true
# defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
# defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
# Automatically open a new Finder window when a volume is mounted
# defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
# defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
# defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Show item info near icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Show item info to the right of the icons on the desktop
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Increase grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 80" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 80" ~/Library/Preferences/com.apple.finder.plist
# Increase the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash
# defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Show the /Volumes folder
sudo chflags nohidden /Volumes
# Remove Dropbox’s green checkmark icons in Finder
# file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
# [ -e "${file}" ] && mv -f "${file}" "${file}.bak"
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Privileges -bool true
###############################################################################
# Dock, Dashboard, and hot corners #
###############################################################################
# Enable highlight hover effect for the grid view of a stack (Dock)
defaults write com.apple.dock mouse-over-hilite-stack -bool true
# Set the icon size of Dock items to 36 pixels
defaults write com.apple.dock tilesize -int 36
# Change minimize/maximize window effect
# defaults write com.apple.dock mineffect -string "scale"
# Minimize windows into their application’s icon
# defaults write com.apple.dock minimize-to-application -bool true
# Enable spring loading for all Dock items
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Wipe all (default) app icons from the Dock
# This is only really useful when setting up a new Mac, or if you don’t use
# the Dock to launch apps.
#defaults write com.apple.dock persistent-apps -array
# Show only open applications in the Dock
#defaults write com.apple.dock static-only -bool true
# Don’t animate opening applications from the Dock
# defaults write com.apple.dock launchanim -bool false
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.2
# Don’t group windows by application in Mission Control
# (i.e. use the old Exposé behavior instead)
defaults write com.apple.dock expose-group-by-app -bool false
# Disable Dashboard
defaults write com.apple.dashboard mcx-disabled -bool true
# Don’t show Dashboard as a Space
defaults write com.apple.dock dashboard-in-overlay -bool true
# Don’t automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
# Minimize the auto-hiding Dock delay
defaults write com.apple.dock autohide-delay -float 0.2
# Change the animation when hiding/showing the Dock
defaults write com.apple.dock autohide-time-modifier -float 1
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Make Dock icons of hidden applications translucent
# defaults write com.apple.dock showhidden -bool true
# Don’t show recent applications in Dock
defaults write com.apple.dock show-recents -bool false
# Disable the Launchpad gesture (pinch with thumb and three fingers)
#defaults write com.apple.dock showLaunchpadGestureEnabled -int 0
# Reset Launchpad, but keep the desktop wallpaper intact
# find "${HOME}/Library/Application Support/Dock" -name "*-*.db" -maxdepth 1 -delete
# Add iOS & Watch Simulator to Launchpad
# sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app" "/Applications/Simulator.app"
# sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/Simulator (Watch).app" "/Applications/Simulator (Watch).app"
# Add a spacer to the left side of the Dock (where the applications are)
#defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Add a spacer to the right side of the Dock (where the Trash is)
#defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Hot corners
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
# 13: Lock Screen
# Top left screen corner → Mission Control
defaults write com.apple.dock wvous-tl-corner -int 2
defaults write com.apple.dock wvous-tl-modifier -int 0
# Top right screen corner → Start screen saver
defaults write com.apple.dock wvous-tr-corner -int 3
defaults write com.apple.dock wvous-tr-modifier -int 0
# Bottom left screen corner → Desktop
defaults write com.apple.dock wvous-bl-corner -int 4
defaults write com.apple.dock wvous-bl-modifier -int 0
# Bottom right screen corner → Start screen saver
defaults write com.apple.dock wvous-br-corner -int 5
defaults write com.apple.dock wvous-br-modifier -int 0
###############################################################################
# Safari & WebKit #
###############################################################################
# Privacy: don’t send search queries to Apple
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
# Press Tab to highlight each item on a web page
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
# Show the full URL in the address bar (note: this still hides the scheme)
defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
# Set Safari’s home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string "about:blank"
# Prevent Safari from opening ‘safe’ files automatically after downloading
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
# Allow hitting the Backspace key to go to the previous page in history
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
# Hide Safari’s bookmarks bar by default
defaults write com.apple.Safari ShowFavoritesBar -bool false
# Hide Safari’s sidebar in Top Sites
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
# Disable Safari’s thumbnail cache for History and Top Sites
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Make Safari’s search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
# Remove useless icons from Safari’s bookmarks bar
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
# Add a context menu item for showing the Web Inspector in web views
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Enable continuous spellchecking
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true
# Disable auto-correct
defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false
# Disable AutoFill
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
defaults write com.apple.Safari AutoFillPasswords -bool false
defaults write com.apple.Safari AutoFillCreditCardData -bool false
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false
# Warn about fraudulent websites
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
# Disable plug-ins
defaults write com.apple.Safari WebKitPluginsEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false
# Disable Java
defaults write com.apple.Safari WebKitJavaEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles -bool false
# Block pop-up windows
defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false
# Disable auto-playing video
#defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
#defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
#defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
#defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
# Enable “Do Not Track”
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
# Update extensions automatically
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
###############################################################################
# Mail #
###############################################################################
# Disable send and reply animations in Mail.app
defaults write com.apple.mail DisableReplyAnimations -bool true
defaults write com.apple.mail DisableSendAnimations -bool true
# Copy email addresses as `[email protected]` instead of `Foo Bar <[email protected]>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Add the keyboard shortcut ⌘ + Enter to send an email in Mail.app
defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\U21a9"
# Display emails in threaded mode, sorted by date (oldest at the top)
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
# Disable inline attachments (just show the icons)
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
# Disable automatic spell checking
# defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled"
###############################################################################
# Spotlight #
###############################################################################
# Hide Spotlight suggestions
defaults write com.apple.lookup.shared LookupSuggestionsDisabled -bool true
# Hide Spotlight tray-icon (and subsequent helper)
#sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
# Disable Spotlight indexing for any volume that gets mounted and has not yet
# been indexed before.
# Use `sudo mdutil -i off "/Volumes/foo"` to stop indexing any volume.
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
# Change indexing order and disable some search results
# Yosemite-specific search results (remove them if you are using macOS 10.9 or older):
# MENU_DEFINITION
# MENU_CONVERSION
# MENU_EXPRESSION
# MENU_SPOTLIGHT_SUGGESTIONS (send search queries to Apple)
# MENU_WEBSEARCH (send search queries to Apple)
# MENU_OTHER
defaults write com.apple.spotlight orderedItems -array \
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
'{"enabled" = 1;"name" = "PDF";}' \
'{"enabled" = 1;"name" = "FONTS";}' \
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
'{"enabled" = 0;"name" = "MESSAGES";}' \
'{"enabled" = 1;"name" = "CONTACT";}' \
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
'{"enabled" = 0;"name" = "IMAGES";}' \
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
'{"enabled" = 0;"name" = "MUSIC";}' \
'{"enabled" = 0;"name" = "MOVIES";}' \
'{"enabled" = 1;"name" = "PRESENTATIONS";}' \
'{"enabled" = 1;"name" = "SPREADSHEETS";}' \
'{"enabled" = 0;"name" = "SOURCE";}' \
'{"enabled" = 0;"name" = "MENU_DEFINITION";}' \
'{"enabled" = 0;"name" = "MENU_OTHER";}' \
'{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
'{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
'{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
'{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
# Load new settings before rebuilding the index
killall mds > /dev/null 2>&1
# Make sure indexing is enabled for the main volume
sudo mdutil -i on / > /dev/null
# Rebuild the index from scratch
sudo mdutil -E / > /dev/null
###############################################################################
# Terminal & iTerm 2 #
###############################################################################
# Only use UTF-8 in Terminal.app
defaults write com.apple.terminal StringEncodings -array 4
# Use a modified version of the Solarized Dark theme by default in Terminal.app
# osascript <<EOD
#
# tell application "Terminal"
#
# local allOpenedWindows
# local initialOpenedWindows
# local windowID
# set themeName to "Solarized Dark xterm-256color"
#
# (* Store the IDs of all the open terminal windows. *)
# set initialOpenedWindows to id of every window
#
# (* Open the custom theme so that it gets added to the list
# of available terminal themes (note: this will open two
# additional terminal windows). *)
# do shell script "open '$HOME/init/" & themeName & ".terminal'"
#
# (* Wait a little bit to ensure that the custom theme is added. *)
# delay 1
#
# (* Set the custom theme as the default terminal theme. *)
# set default settings to settings set themeName
#
# (* Get the IDs of all the currently opened terminal windows. *)
# set allOpenedWindows to id of every window
#
# repeat with windowID in allOpenedWindows
#
# (* Close the additional windows that were opened in order
# to add the custom theme to the list of terminal themes. *)
# if initialOpenedWindows does not contain windowID then
# close (every window whose id is windowID)
#
# (* Change the theme for the initial opened terminal windows
# to remove the need to close them in order for the custom
# theme to be applied. *)
# else
# set current settings of tabs of (every window whose id is windowID) to settings set themeName
# end if
#
# end repeat
#
# end tell
#
# EOD
# Enable “focus follows mouse” for Terminal.app and all X11 apps
# i.e. hover over a window and start typing in it without clicking first
#defaults write com.apple.terminal FocusFollowsMouse -bool true
#defaults write org.x.X11 wm_ffm -bool true
# Enable Secure Keyboard Entry in Terminal.app
# See: https://security.stackexchange.com/a/47786/8918
defaults write com.apple.terminal SecureKeyboardEntry -bool true
# Disable the annoying line marks
defaults write com.apple.Terminal ShowLineMarks -int 0
# Install the Solarized Dark theme for iTerm
# open "${HOME}/init/Solarized Dark.itermcolors"
# Don’t display the annoying prompt when quitting iTerm
# defaults write com.googlecode.iterm2 PromptOnQuit -bool false
###############################################################################
# Time Machine #
###############################################################################
# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Disable local Time Machine backups
hash tmutil &> /dev/null && sudo tmutil disablelocal
###############################################################################
# Activity Monitor #
###############################################################################
# Show the main window when launching Activity Monitor
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
# Visualize CPU usage in the Activity Monitor Dock icon
defaults write com.apple.ActivityMonitor IconType -int 5
# Show all processes in Activity Monitor
defaults write com.apple.ActivityMonitor ShowCategory -int 0
# Sort Activity Monitor results by CPU usage
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
###############################################################################
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility #
###############################################################################
# Prefer full name to shortnames and nicknames
defaults write NSGlobalDomain NSPersonNameDefaultShortNameEnabled -bool false
defaults write NSGlobalDomain NSPersonNameDefaultShortNameFormat -bool false
defaults write NSGlobalDomain NSPersonNameDefaultShouldPreferNicknamesPreference -bool false
# Enable the debug menu in Address Book
defaults write com.apple.addressbook ABShowDebugMenu -bool true
# Enable Dashboard dev mode (allows keeping widgets on the desktop)
defaults write com.apple.dashboard devmode -bool true
# Enable the debug menu in iCal (pre-10.8)
defaults write com.apple.iCal IncludeDebugMenu -bool true
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
# Enable the debug menu in Disk Utility
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
# Auto-play videos when opened with QuickTime Player
defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true
###############################################################################
# Mac App Store #
###############################################################################
# Enable the WebKit Developer Tools in the Mac App Store
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
# Enable Debug Menu in the Mac App Store
defaults write com.apple.appstore ShowDebugMenu -bool true
# Enable the automatic update check
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Download newly available updates in background
# defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
# Install System data files & security updates
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
# Automatically download apps purchased on other Macs
defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1
# Turn on app auto-update
defaults write com.apple.commerce AutoUpdate -bool true
# Allow the App Store to reboot machine on macOS updates
# defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
###############################################################################
# Photos #
###############################################################################
# Prevent Photos from opening automatically when devices are plugged in
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
###############################################################################
# Messages #
###############################################################################
# Disable automatic emoji substitution (i.e. use plain text smileys)
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
# Disable smart quotes as it’s annoying for messages that contain code
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
# Disable continuous spell checking
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
###############################################################################
# Google Chrome & Google Chrome Canary #
###############################################################################
# Disable the all too sensitive backswipe on trackpads
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
# Disable the all too sensitive backswipe on Magic Mouse
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool false
# Use the system-native print preview dialog
defaults write com.google.Chrome DisablePrintPreview -bool true
defaults write com.google.Chrome.canary DisablePrintPreview -bool true
# Expand the print dialog by default
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true
###############################################################################
# GPGMail 2 #
###############################################################################
# Disable signing emails by default
defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false
###############################################################################
# Opera & Opera Developer #
###############################################################################
# Expand the print dialog by default
defaults write com.operasoftware.Opera PMPrintingExpandedStateForPrint2 -boolean true
defaults write com.operasoftware.OperaDeveloper PMPrintingExpandedStateForPrint2 -boolean true
###############################################################################
# SizeUp.app #
###############################################################################
# Start SizeUp at login
# defaults write com.irradiatedsoftware.SizeUp StartAtLogin -bool true
# Don’t show the preferences window on next start
# defaults write com.irradiatedsoftware.SizeUp ShowPrefsOnNextStart -bool false
###############################################################################
# Sublime Text #
###############################################################################
# Install Sublime Text settings
# cp -r preferences/Preferences.sublime-settings ~/Library/Application\ Support/Sublime\ Text*/Packages/User/Preferences.sublime-settings 2> /dev/null
###############################################################################
# Spectacle.app #
###############################################################################
# Set up my preferred keyboard shortcuts
# cp -r init/spectacle.json ~/Library/Application\ Support/Spectacle/Shortcuts.json 2> /dev/null
###############################################################################
# Transmission.app #
###############################################################################
# Use `~/Documents/Torrents` to store incomplete downloads
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
# Use `~/Downloads` to store completed downloads
defaults write org.m0k.transmission DownloadLocationConstant -bool true
# Don’t prompt for confirmation before downloading
defaults write org.m0k.transmission DownloadAsk -bool false
defaults write org.m0k.transmission MagnetOpenAsk -bool false
# Don’t prompt for confirmation before removing non-downloading active transfers
defaults write org.m0k.transmission CheckRemoveDownloading -bool true
# Trash original torrent files
defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
# Hide the donate message
defaults write org.m0k.transmission WarningDonate -bool false
# Hide the legal disclaimer
defaults write org.m0k.transmission WarningLegal -bool false
# IP block list.
# Source: https://giuliomac.wordpress.com/2014/02/19/best-blocklist-for-transmission/
defaults write org.m0k.transmission BlocklistNew -bool true
defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz"
defaults write org.m0k.transmission BlocklistAutoUpdate -bool true
# Randomize port on launch
defaults write org.m0k.transmission RandomPort -bool true
###############################################################################
# Twitter.app #
###############################################################################
# Disable smart quotes as it’s annoying for code tweets
defaults write com.twitter.twitter-mac AutomaticQuoteSubstitutionEnabled -bool false
# Show the app window when clicking the menu bar icon
defaults write com.twitter.twitter-mac MenuItemBehavior -int 1
# Enable the hidden ‘Develop’ menu
defaults write com.twitter.twitter-mac ShowDevelopMenu -bool true
# Open links in the background
defaults write com.twitter.twitter-mac openLinksInBackground -bool true
# Allow closing the ‘new tweet’ window by pressing `Esc`
defaults write com.twitter.twitter-mac ESCClosesComposeWindow -bool true
# Show full names rather than Twitter handles
# defaults write com.twitter.twitter-mac ShowFullNames -bool true
# Hide the app in the background if it’s not the front-most window
# defaults write com.twitter.twitter-mac HideInBackground -bool true
###############################################################################
# Tweetbot.app #
###############################################################################
# Bypass the annoyingly slow t.co URL shortener
defaults write com.tapbots.TweetbotMac OpenURLsDirectly -bool true
###############################################################################
# Kill affected applications #
###############################################################################
for app in "Activity Monitor" \
"Address Book" \
"Calendar" \
"cfprefsd" \
"Contacts" \
"Dock" \
"Finder" \
"Google Chrome Canary" \
"Google Chrome" \
"Mail" \
"Messages" \
"Opera" \
"Photos" \
"Safari" \
"SizeUp" \
"Spectacle" \
"SystemUIServer" \
"Terminal" \
"Transmission" \
"Tweetbot" \
"Twitter" \
"iCal"; do
killall "${app}" &> /dev/null
done
echo "Done. Note that some of these changes require a logout/restart to take effect."
|
cyrusstoller/dotfiles
|
preferences/macos-preferences.sh
|
Shell
|
mit
| 43,921 |
#!/usr/bin/zsh
alias zfrtags='ctags -R --extra=+f .'
alias zfrbuild='date; zfrtags; rm -f clean.txt; rm -f build.txt; ./MakeAndTestAll.bat &> build.txt; grep --color=always -in -E "fatal|error|warning|critical|failure" clean.txt build.txt; date;'
alias zfrclean='date; rm -f build.txt; ./CleanAll.bat &> clean.txt; date;'
alias zfrerror='grep --color=always -in -E "fatal|error|warning|critical|failure" clean.txt build.txt'
|
therealjumbo/setup_win
|
dotfiles/work_aliases.sh
|
Shell
|
mit
| 427 |
#!/bin/bash
source variable.sh
####################
# #
# setup iptables #
# #
####################
# setup network core configure
echo "1" > /proc/sys/net/ipv4/tcp_syncookies
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
for i in /proc/sys/net/ipv4/conf/*/{rp_filter,log_martians}; do
echo "1" > $i
done
for i in /proc/sys/net/ipv4/conf/*/{accept_source_route,accept_redirects,send_redirects}; do
echo "0" > $i
done
# clear old rules
$IPTABLE -F
$IPTABLE -X
$IPTABLE -Z
# set default policy
$IPTABLE -P INPUT DROP
$IPTABLE -P OUTPUT DROP
$IPTABLE -P FORWARD DROP
# allow all lo interface trafic
$IPTABLE -A INPUT -i lo -j ACCEPT
$IPTABLE -A OUTPUT -o lo -j ACCEPT
# allow state is RELATED, ESTABLISHED
$IPTABLE -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLE -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# drop all icmp packets
# $IPTABLE -A INPUT -t icmp -j DROP
# open input ports
for port in $OPEN_INPUT_PORTS; do
#$IPTABLE -A INPUT -p tcp -i $EXTINF --dport $port -j ACCEPT
$IPTABLE -A INPUT -i $EXTINF -p tcp -s 0/0 --sport 1024:65535 --dport $port -m state --state NEW,ESTABLISHED -j ACCEPT
$IPTABLE -A OUTPUT -o $EXTINF -p tcp --sport $port -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
done
# open output ports
for port in $OPEN_OUTPUT_PORTS; do
$IPTABLE -A OUTPUT -o $EXTINF -p tcp --dport $port -m state --state NEW,ESTABLISHED -j ACCEPT
$IPTABLE -A INPUT -i $EXTINF -p tcp --sport $port -m state --state ESTABLISHED -j ACCEPT
done
# open dns udp
$IPTABLE -A OUTPUT -p udp -o $EXTINF --dport 53 -j ACCEPT
# open ntp udp
$IPTABLE -A OUTPUT -p udp -o $EXTINF --dport 123 -j ACCEPT
# Drop sync
$IPTABLE -A INPUT -i $EXTINF -p tcp ! --syn -m state --state NEW -j DROP
# Drop Fragments
$IPTABLE -A INPUT -i $EXTINF -f -j DROP
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags ALL ALL -j DROP
# Drop NULL packets
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags ALL NONE -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix " NULL Packets "
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags ALL NONE -j DROP
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
# Drop XMAS
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags SYN,FIN SYN,FIN -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix " XMAS Packets "
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
# Drop FIN packet scans
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags FIN,ACK FIN -m limit --limit 5/m --limit-burst 7 -j LOG --log-prefix " Fin Packets Scan "
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags FIN,ACK FIN -j DROP
$IPTABLE -A INPUT -i $EXTINF -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
# prevent DoS attack
$IPTABLE -A INPUT -i $EXTINF -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT
$IPTABLE -N syn_flood
$IPTABLE -A INPUT -p tcp --syn -j syn_flood
$IPTABLE -A syn_flood -m limit --limit 1/s --limit-burst 3 -j RETURN
$IPTABLE -A syn_flood -j DROP
#Limiting the incoming icmp ping request:
#$IPTABLE -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j ACCEPT
#$IPTABLE -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j LOG --log-prefix PING-DROP:
#$IPTABLE -A INPUT -p icmp -j DROP
#$IPTABLE -A OUTPUT -p icmp -j ACCEPT
/usr/libexec/iptables/iptables.init save
|
herb123456/CentOS-autobuild-script
|
iptables.sh
|
Shell
|
mit
| 3,467 |
pkill node
|
katiewsimon/coffeefilte.red
|
stop_server.sh
|
Shell
|
mit
| 11 |
#!/bin/bash
# default mode "PROD"
CW_MODE=${CW_MODE:-'PROD'}
# Valid modes: PROD, WORKER, FAST, DEV
if [[ $CW_MODE == 'PROD' || $CW_MODE == 'FAST' ]]; then
rm -f /clinwiki/tmp/pids/server.pid
fi
bundle install
echo MODE=$CW_MODE
flock -x ./entrypoint.lock bundle exec rake db:create
flock -x ./entrypoint.lock bundle exec rake db:migrate
if [ $CW_MODE == "PROD" ]; then
./front/scripts/build
fi
# load env
if [ -f ".env" ]; then
. .env
fi
# This line executes the CMD from Dockerfile, command from docker-compose file or if you docker run
echo MODE=$CW_MODE
if [ $CW_MODE == "DEV" ]; then
echo "Waiting for user to start rails server manually..."
echo "docker exec -it clinwiki bundle exec rails server -b 0.0.0.0"
while :
do sleep 3600
done
else
exec "$@"
fi
|
clinwiki-org/clinwiki
|
compose/entrypoint.sh
|
Shell
|
mit
| 801 |
set -ex
if ! grep --quiet "deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free" /etc/apt/sources.list.d/virtualbox.list; then
sh -c "echo 'deb http://download.virtualbox.org/virtualbox/debian '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list"
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | apt-key add -
apt-get update
apt-get install virtualbox-5.0 -y
fi
echo "Successfully installed virtualbox"
|
c0state/python-skeleton-for-ci-cd
|
provisioning/install_virtualbox.sh
|
Shell
|
mit
| 509 |
#!/bin/bash -le
source .rvmrc
# install bundler if necessary
set -e
gem install bundler --no-ri --no-rdoc && bundle install
# debugging info
echo USER=$USER && ruby --version && which ruby && which bundle
bundle exec rspec spec
|
pivotal/lobot
|
lib/lobot/templates/default_rails_build_script.sh
|
Shell
|
mit
| 233 |
#!/bin/bash
#
#SBATCH --job-name=us_rnn_4
#SBATCH --mem=10000
#SBATCH --partition=titanx-long
#SBATCH --output=us_experiment_%A.out
#SBATCH --error=us_experiment_%A.err
# Log what we're running and where.
echo $SLURM_JOBID - `hostname` >> ~/slurm-lstm-jobs.txt
module purge
module load tensorflow/1.0.0
cd /home/usaxena/work/690/project/src/rnn
python babi-rnn.py 4
|
uditsaxena/690N-final-project
|
slurm_sh/slurm_4.sh
|
Shell
|
mit
| 368 |
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/ScreenType/ScreenType.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/ScreenType/ScreenType.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi
|
allgamesallfree/ScreenType
|
Example/Pods/Target Support Files/Pods-ScreenType_Example/Pods-ScreenType_Example-frameworks.sh
|
Shell
|
mit
| 4,670 |
#! /bin/bash
export KINDLEGEN=/usr/local/bin/kindlegen
echo "Cleaning up..."
rm -rf ./build
echo "Building API docs..."
lein codox
echo "Building the Guides..."
pushd docs/guides
bundle install
bundle exec rake compile
ls
popd
mkdir -p ./build/
mv -v docs/guides/_build ./build/
mv -v ./build/_build ./build/guides
cp -rv docs/guides/CNAME ./build/
mv -v docs/api/ ./build/
echo "Deploying"
git branch -D gh-pages
git checkout --orphan gh-pages
git rm -rf ./
rm -rf node_modules
rm pom.xml
rm -rf docs/_build/
rm -rf target
rm -rf ./scripts
cp -rv build/* ./
rm -rf build/
git add .
now=`date +%s`
git commit -a -m "Release at $now"
git push origin gh-pages -f
git checkout master
echo "Done"
|
Codamic/hellhound
|
scripts/deploy_docs.sh
|
Shell
|
mit
| 695 |
#!/bin/bash
#####################################################################
# File: install_registry.sh
# Author: Rahul Sharma <[email protected]>
# Desc: automates the task of generating self-signed certificates
# and placing them in specified locations. The script uses
# docker-compose to pull and run docker-registry container.
#
# Target platform: ubuntu
#
# Dependencies
# -----------------
# 1. docker
# 2. docker-compose
# 3. openssl
#
# Command to use (run as sudo user)
# ----------------------------------
# bash# ./install_registry.sh <ip-address> <port-number>
# example: ./install_registry.sh 10.10.10.22 5000
#
#####################################################################
if [ $# -ne 2 ]; then
echo "Error: Wrong arguments provided."
echo "Usage: ./filename <param1> <param2>"
echo "NOTE: param1: ip-address used to communicate with docker-registry."
echo " param2: port used to communicate with docker registry."
exit 1
fi
DOCKERCERTS="/etc/docker/certs.d"
CERTSDIR="/opt/docker"
CACERTS=$CERTSDIR/ca
REGISTRYCERTS=$CERTSDIR/registry
IMAGESTORE="/var/lib/registry"
AUTHDIR=$CERTSDIR/auth
mkdir -p $DOCKERCERTS
mkdir -p $CERTSDIR
mkdir -p $CACERTS
mkdir -p $REGISTRYCERTS
mkdir -p $IMAGESTORE
mkdir -p $AUTHDIR
cat > cacert.cfg << EOF
[req]
distinguished_name = req_distinguished_name
prompt = no
[req_distinguished_name]
C = US
ST = MA
L = Boston
O = Custom Cert Authority
OU = Signing
CN = custom.cert.org
[v3_req]
[alt_names]
EOF
cat > host.cfg << EOF
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = MA
L = Boston
O = CS7680_CLOUD_COMPUTING
OU = DOCKER
CN = $1
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = $1
DNS.2 = 127.0.0.1
IP.1 = $1
IP.2 = 127.0.0.1
EOF
function gen_ca() {
# generating ca's key
openssl genrsa -out ca.key 4096
# generating ca's cert
openssl req -x509 -new -nodes -sha256 -key ca.key -days 365 \
-out ca.crt -config cacert.cfg
}
function gen_host() {
# generating host key
openssl genrsa -out host.key 4096
# generating host certificate-signing-request (CSR request)
openssl req -new -sha256 -key host.key -out host.csr \
-config host.cfg
}
function sign_cert() {
# signing host's CSR request with CA's key, cert and
# generating host's cert
openssl x509 -req -sha256 -in host.csr -CA ca.crt \
-CAkey ca.key -CAcreateserial -out host.crt \
-days 365 -extensions v3_req -extfile host.cfg
}
# Generate ca and host certificates
CAKEY=$CACERTS/ca.key
CACRT=$CACERTS/ca.crt
if [ -f "$CAKEY" ] || [ -f "$CACRT" ]
then
cp $CAKEY .
cp $CACRT .
else
gen_ca
fi
gen_host
sign_cert
# Install ca-cert for docker
mkdir -p $DOCKERCERTS/$1:$2
cp ca.crt $DOCKERCERTS/$1:$2/
# add to system's rootca authority (for ubuntu)
cp ca.crt /usr/local/share/ca-certificates/$1.crt
update-ca-certificates
# copy the certs to /opt/certs directory
cp host.crt $REGISTRYCERTS
cp host.key $REGISTRYCERTS
cp ca.crt $CACERTS
cp ca.key $CACERTS
# restart docker service
service docker restart
# get username and password from user
echo -n "Enter username you want to configure and press [ENTER]: "
read uname
echo -n "Enter password and press [ENTER]: "
read password
docker run --entrypoint htpasswd registry:2 -Bbn $uname $password \
> $AUTHDIR/htpasswd
# generate docker-compose file
cat > docker-compose.yml << EOF
registry:
restart: always
image: registry:2.1.1
ports:
- $2:5000
environment:
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/host.crt
REGISTRY_HTTP_TLS_KEY: /certs/host.key
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: "Registry Realm"
volumes:
- $IMAGESTORE:/var/lib/registry
- $REGISTRYCERTS:/certs
- $AUTHDIR:/auth
- ./config.yml:/etc/docker/registry/config.yml
EOF
docker-compose up -d
# cleanup
rm -rf *.cfg
rm -rf *.crt
rm -rf *.key
rm -rf *.csr
rm -rf *.srl
|
BU-NU-CLOUD-SP16/Container-Safety-Determination
|
registry/install_registry.sh
|
Shell
|
mit
| 4,118 |
#!/bin/bash
# --------------------------------------------------------------------------------------------------
# Killing all active agents to start clean.
#
# Ch.Paus: Version 0.0 (Apr 27, 2015)
# --------------------------------------------------------------------------------------------------
function killAgent {
# function that will install the daemon named as the given first parameter
# example: install reviewd
# command line parameter
daemon="$1"
process="$2"
# stop potentially existing server process
if [ -e "/etc/init.d/${daemon}" ]
then
/etc/init.d/${daemon} status
/etc/init.d/${daemon} stop
fi
killall $daemon
if ! [ -z "$process" ]
then
killall $process
fi
list=`ps auxw |grep $KRAKEN_USER | grep -v grep | grep jobSitter| tr -s ' '| cut -d ' ' -f2`
if [ "$list" != "" ]
then
kill $list
fi
ps auxw |grep $KRAKEN_USER | grep -v grep | grep $daemon
if ! [ -z "$process" ]
then
ps auxw |grep $KRAKEN_USER | grep -v grep | grep $process
fi
}
#---------------------------------------------------------------------------------------------------
# M A I N
#---------------------------------------------------------------------------------------------------
# Setup the environment
source ../setup.sh
source ./setup.sh
# kill all daemons and main processes inside
#===========================================
killAgent reviewd reviewRequests.py
killAgent catalogd
killAgent cleanupd reviewRequests.py
exit 0
|
cpausmit/Kraken
|
agents/killAgents.sh
|
Shell
|
mit
| 1,604 |
# swap disk, create addition swap space on host
# Notes:
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s2-swap-creating-file.html
print_with_head creating swap - run as root
swapDestination="/data/swapfile"
swapoff $swapDestination ; \rm -rf $swapDestination
swapInGb=1
swapSize=$((swapInGb*1024*1024))
dd if=/dev/zero of=$swapDestination bs=1024 count=$swapSize
chmod 0600 $swapDestination
mkswap $swapDestination
swapon $swapDestination
|
csap-platform/csap-core
|
csap-core-service/src/main/resources/csap-templates/shell-scripts/memory-swap.sh
|
Shell
|
mit
| 499 |
#!/usr/bin/env bash
# Provides json.sh
# Description Este archivo contiene valores por defecto de variables utilizadas en la instalacion
# Repositorio GitHub: https://github.com/dominictarr/JSON.sh
# License https://github.com/dominictarr/JSON.sh/blob/master/LICENSE.APACHE2
# https://github.com/dominictarr/JSON.sh/blob/master/LICENSE.MIT
# Copyright 2011 Dominic Tarr
function throw () {
echo "$*" >&2
exit 1
}
BRIEF=0
LEAFONLY=0
PRUNE=0
NORMALIZE_SOLIDUS=0
function usage() {
echo
echo "Usage: JSON.sh [-b] [-l] [-p] [-s] [-h]"
echo
echo "-p - Prune empty. Exclude fields with empty values."
echo "-l - Leaf only. Only show leaf nodes, which stops data duplication."
echo "-b - Brief. Combines 'Leaf only' and 'Prune empty' options."
echo "-s - Remove escaping of the solidus symbol (stright slash)."
echo "-h - This help text."
echo
}
function parse_options() {
set -- "$@"
local ARGN=$#
while [ "$ARGN" -ne 0 ]
do
case $1 in
-h) usage
exit 0
;;
-b) BRIEF=1
LEAFONLY=1
PRUNE=1
;;
-l) LEAFONLY=1
;;
-p) PRUNE=1
;;
-s) NORMALIZE_SOLIDUS=1
;;
?*) echo "ERROR: Unknown option."
usage
exit 0
;;
esac
shift 1
ARGN=$((ARGN-1))
done
}
function awk_egrep () {
local pattern_string=$1
gawk '{
while ($0) {
start=match($0, pattern);
token=substr($0, start, RLENGTH);
print token;
$0=substr($0, start+RLENGTH);
}
}' pattern="$pattern_string"
}
function tokenize () {
local GREP
local ESCAPE
local CHAR
if echo "test string" | egrep -ao --color=never "test" &>/dev/null
then
GREP='egrep -ao --color=never'
else
GREP='egrep -ao'
fi
if echo "test string" | egrep -o "test" &>/dev/null
then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]'
else
GREP=awk_egrep
ESCAPE='(\\\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\\\]'
fi
local STRING="\"$CHAR*($ESCAPE$CHAR*)*\""
local NUMBER='-?(0|[1-9][0-9]*)([.][0-9]*)?([eE][+-]?[0-9]*)?'
local KEYWORD='null|false|true'
local SPACE='[[:space:]]+'
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | egrep -v "^$SPACE$"
}
function parse_array () {
local index=0
local ary=''
read -r token
case "$token" in
']') ;;
*)
while :
do
parse_value "$1" "$index"
index=$((index+1))
ary="$ary""$value"
read -r token
case "$token" in
']') break ;;
',') ary="$ary," ;;
*) throw "EXPECTED , or ] GOT ${token:-EOF}" ;;
esac
read -r token
done
;;
esac
[ "$BRIEF" -eq 0 ] && value=$(printf '[%s]' "$ary") || value=
:
}
function parse_object () {
local key
local obj=''
read -r token
case "$token" in
'}') ;;
*)
while :
do
case "$token" in
'"'*'"') key=$token ;;
*) throw "EXPECTED string GOT ${token:-EOF}" ;;
esac
read -r token
case "$token" in
':') ;;
*) throw "EXPECTED : GOT ${token:-EOF}" ;;
esac
read -r token
parse_value "$1" "$key"
obj="$obj$key:$value"
read -r token
case "$token" in
'}') break ;;
',') obj="$obj," ;;
*) throw "EXPECTED , or } GOT ${token:-EOF}" ;;
esac
read -r token
done
;;
esac
[ "$BRIEF" -eq 0 ] && value=$(printf '{%s}' "$obj") || value=
:
}
function parse_value () {
local jpath="${1:+$1,}$2" isleaf=0 isempty=0 print=0
case "$token" in
'{') parse_object "$jpath" ;;
'[') parse_array "$jpath" ;;
# At this point, the only valid single-character tokens are digits.
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
*) value=$token
# if asked, replace solidus ("\/") in json strings with normalized value: "/"
[ "$NORMALIZE_SOLIDUS" -eq 1 ] && value=${value//\\\//\/}
isleaf=1
[ "$value" = '""' ] && isempty=1
;;
esac
[ "$value" = '' ] && return
[ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 0 ] && print=1
[ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && [ $PRUNE -eq 0 ] && print=1
[ "$LEAFONLY" -eq 0 ] && [ "$PRUNE" -eq 1 ] && [ "$isempty" -eq 0 ] && print=1
[ "$LEAFONLY" -eq 1 ] && [ "$isleaf" -eq 1 ] && \
[ $PRUNE -eq 1 ] && [ $isempty -eq 0 ] && print=1
[ "$print" -eq 1 ] && printf "[%s]\t%s\n" "$jpath" "$value"
:
}
function parse () {
read -r token
parse_value
read -r token
case "$token" in
'') ;;
*) throw "EXPECTED EOF GOT $token" ;;
esac
}
if ([ "$0" = "$BASH_SOURCE" ] || ! [ -n "$BASH_SOURCE" ]);
then
parse_options "$@"
tokenize | parse
fi
|
diegoangel/people-counter
|
INSTALL/include/json.sh
|
Shell
|
mit
| 4,825 |
#!/bin/bash
# File: converter_beta.sh
# Date: March 20th, 2017
# Time: 22:05:12 +0800
# Author: kn007 <[email protected]>
# Blog: https://kn007.net
# Link: https://github.com/kn007/silk-v3-decoder
# Usage: sh converter.sh silk_v3_file/input_folder output_format/output_folder flag(format)
# Flag: not define ---- not define, convert a file
# other value ---- format, convert a folder, batch conversion support
# Requirement: gcc ffmpeg
# Colors
RED="\e[31;1m"
GREEN="\e[32;1m"
YELLOW="\e[33;1m"
WHITE="\e[37;1m"
RESET="\e[0m"
# Main
cur_dir=$(cd `dirname $0`; pwd)
if [ ! -r "$cur_dir/silk/decoder" ]; then
echo -e "${WHITE}[Notice]${RESET} Silk v3 Decoder is not found, compile it."
cd $cur_dir/silk
make && make decoder
[ ! -r "$cur_dir/silk/decoder" ]&&echo -e "${RED}[Error]${RESET} Silk v3 Decoder Compile False, Please Check Your System For GCC."&&exit
echo -e "${WHITE}========= Silk v3 Decoder Compile Finish =========${RESET}"
fi
cd $cur_dir
while [ $3 ]; do
pidof /usr/bin/ffmpeg&&echo -e "${RED}[Error]${RESET} ffmpeg is occupied by another application, please check it."&&exit
[ ! -d "$1" ]&&echo -e "${RED}[Error]${RESET} Input folder not found, please check it."&&exit
TOTAL=$(ls $1|wc -l)
[ ! -d "$2" ]&&mkdir "$2"&&echo -e "${WHITE}[Notice]${RESET} Output folder not found, create it."
[ ! -d "$2" ]&&echo -e "${RED}[Error]${RESET} Output folder could not be created, please check it."&&exit
CURRENT=0
echo -e "${WHITE}========= Batch Conversion Start ==========${RESET}"
ls $1 | while read line; do
let CURRENT+=1
$cur_dir/silk/decoder "$1/$line" "$2/$line.pcm" > /dev/null 2>&1
if [ ! -f "$2/$line.pcm" ]; then
ffmpeg -y -i "$1/$line" "$2/${line%.*}.$3" > /dev/null 2>&1 &
ffmpeg_pid=$!
while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
[ -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${GREEN}[OK]${RESET} Convert $line to ${line%.*}.$3 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&continue
sed -i '1i\\#\!AMR' "$1/$line"
ffmpeg -y -i "$1/$line" "$2/${line%.*}.$3" > /dev/null 2>&1 &
ffmpeg_pid=$!
while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
[ -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${YELLOW}[Warning]${RESET} Could not recognize this file, force using ffmpeg convert $line to ${line%.*}.$3 success, maybe have error.${RESET}"&&continue
echo -e "[$CURRENT/$TOTAL]${RED}[Error]${RESET} Convert $line false, maybe not a audio file."&&continue
fi
ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$2/$line.pcm" "$2/${line%.*}.$3" > /dev/null 2>&1 &
ffmpeg_pid=$!
while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
rm "$2/$line.pcm"
[ ! -f "$2/${line%.*}.$3" ]&&echo -e "[$CURRENT/$TOTAL]${RED}[Error]${RESET} Convert $line false, maybe ffmpeg no format handler for $3."&&continue
echo -e "[$CURRENT/$TOTAL]${GREEN}[OK]${RESET} Convert $line To ${line%.*}.$3 Finish."
done
echo -e "${WHITE}========= Batch Conversion Finish =========${RESET}"
exit
done
$cur_dir/silk/decoder "$1" "$1.pcm" > /dev/null 2>&1
if [ ! -f "$1.pcm" ]; then
ffmpeg -y -i "$1" "${1%.*}.$2" > /dev/null 2>&1 &
ffmpeg_pid=$!
while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
[ -f "${1%.*}.$2" ]&&echo -e "${GREEN}[OK]${RESET} Convert $1 to ${1%.*}.$2 success, ${YELLOW}but not a silk v3 encoded file.${RESET}"&&exit
sed -i '1i\\#\!AMR' "$1"
ffmpeg -y -i "$1" "${1%.*}.$2" > /dev/null 2>&1 &
ffmpeg_pid=$!
while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
[ -f "${1%.*}.$2" ]&&echo -e "${YELLOW}[Warning]${RESET} Could not recognize this file, force using ffmpeg convert $1 to ${1%.*}.$2 success, maybe have error.${RESET}"&&exit
echo -e "${RED}[Error]${RESET} Convert $1 false, maybe not a audio file."&&exit
fi
ffmpeg -y -f s16le -ar 24000 -ac 1 -i "$1.pcm" "${1%.*}.$2" > /dev/null 2>&1
ffmpeg_pid=$!
while kill -0 "$ffmpeg_pid"; do sleep 1; done > /dev/null 2>&1
rm "$1.pcm"
[ ! -f "${1%.*}.$2" ]&&echo -e "${RED}[Error]${RESET} Convert $1 false, maybe ffmpeg no format handler for $2."&&exit
echo -e "${GREEN}[OK]${RESET} Convert $1 To ${1%.*}.$2 Finish."
exit
|
kn007/silk-v3-decoder
|
converter_beta.sh
|
Shell
|
mit
| 4,131 |
for d in {repository,logic,rest,cassandra,hazelcast,rabbit}
do
echo "LOGS for $d"
docker logs $d
echo ""
echo ""
done
|
gang-tetris/test-services-integration-test
|
show_logs.sh
|
Shell
|
mit
| 135 |
#!/bin/sh
# MIT License
#
# Copyright (c) 2016 Radio Revolt, the Student Radio of Trondheim
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
if test `whoami` != "$1"
then (>&2 echo "Error: The application must be run as $1, not `whoami`")
exit 1
else exit 0
fi
|
RadioRevolt/slack-systemctl
|
confirm_is_run_as.sh
|
Shell
|
mit
| 1,280 |
#!/usr/bin/env bash
# Grab QR codes from webcam
# Grab and save the path to this script
# http://stackoverflow.com/a/246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPTDIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
# echo "${SCRIPTDIR}" # For debugging
if [[ $(jq '.useQRcodes' "${HOME}/.arlobot/personalDataForBehavior.json") == true ]]; then
if (pkill zbarcam); then
while (pkill zbarcam); do
echo "Waiting for zbarcam to close . . ."
sleep 1
done
fi
CAMERA_NAME=$(jq '.qrCameraName' "${HOME}/.arlobot/personalDataForBehavior.json" | tr -d '"')
if [[ -z ${CAMERA_NAME} ]]; then
exit 1
fi
VIDEO_DEVICE=$("${SCRIPTDIR}/find_camera.sh" "${CAMERA_NAME}")
if [[ -z ${VIDEO_DEVICE} ]]; then
exit 1
fi
zbarcam -q --raw --nodisplay "${VIDEO_DEVICE}"
fi
|
chrisl8/ArloBot
|
scripts/getQRcodes.sh
|
Shell
|
mit
| 1,112 |
#!/usr/bin/env bash
# http://askubuntu.com/questions/179628/how-can-i-open-irc-links-in-pidgin-from-chromium
sudo cp /usr/share/applications/psi.desktop /usr/share/applications/psi.desktop.orig
sudo sed -i 's/Exec=.*/Exec=psi --uri=%U/g' /usr/share/applications/psi.desktop
xdg-mime default psi.desktop x-scheme-handler/xmpp
|
renfeng/xmpp-message
|
xmpp.sh
|
Shell
|
mit
| 325 |
#!/bin/sh -e
DIR=$PWD
check_config_value () {
unset test_config
test_config=$(grep "${config}=" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=${value} >> ./KERNEL/.config"
else
if [ ! "x${test_config}" = "x${config}=${value}" ] ; then
echo "sed -i -e 's:${test_config}:${config}=${value}:g' ./KERNEL/.config"
fi
fi
}
check_config_builtin () {
unset test_config
test_config=$(grep "${config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=y >> ./KERNEL/.config"
fi
}
check_config_module () {
unset test_config
test_config=$(grep "${config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${config}=y" ] ; then
echo "sed -i -e 's:${config}=y:${config}=m:g' ./KERNEL/.config"
else
unset test_config
test_config=$(grep "${config}=" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=m >> ./KERNEL/.config"
fi
fi
}
check_config () {
unset test_config
test_config=$(grep "${config}=" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
echo "echo ${config}=y >> ./KERNEL/.config"
echo "echo ${config}=m >> ./KERNEL/.config"
fi
}
check_config_disable () {
unset test_config
test_config=$(grep "${config} is not set" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x" ] ; then
unset test_config
test_config=$(grep "${config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${config}=y" ] ; then
echo "sed -i -e 's:${config}=y:# ${config} is not set:g' ./KERNEL/.config"
else
echo "sed -i -e 's:${config}=m:# ${config} is not set:g' ./KERNEL/.config"
fi
fi
}
check_if_set_then_set_module () {
unset test_config
test_config=$(grep "${if_config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${if_config}=y" ] ; then
check_config_module
fi
}
check_if_set_then_set () {
unset test_config
test_config=$(grep "${if_config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${if_config}=y" ] ; then
check_config_builtin
fi
}
check_if_set_then_disable () {
unset test_config
test_config=$(grep "${if_config}=y" ${DIR}/patches/defconfig || true)
if [ "x${test_config}" = "x${if_config}=y" ] ; then
check_config_disable
fi
}
# Linux/arm 3.12.8 Kernel Configuration
#
# RCU Subsystem
#
config="CONFIG_IKCONFIG"
check_config_builtin
config="CONFIG_IKCONFIG_PROC"
check_config_builtin
config="CONFIG_LOG_BUF_SHIFT"
value="18"
check_config_value
config="CONFIG_CHECKPOINT_RESTORE"
check_config_disable
config="CONFIG_CC_OPTIMIZE_FOR_SIZE"
check_config_builtin
config="CONFIG_SYSCTL_SYSCALL"
check_config_builtin
config="CONFIG_KALLSYMS_ALL"
check_config_builtin
config="CONFIG_EMBEDDED"
check_config_builtin
#
# Kernel Performance Events And Counters
#
config="CONFIG_SLUB_DEBUG"
check_config_disable
config="CONFIG_SLAB"
check_config_disable
config="CONFIG_SLUB"
check_config_builtin
config="CONFIG_OPROFILE"
check_config_builtin
config="CONFIG_JUMP_LABEL"
check_config_disable
config="CONFIG_HAVE_ARCH_SECCOMP_FILTER"
check_config_builtin
config="CONFIG_SECCOMP_FILTER"
check_config_builtin
#v3.14-rc1
config="CONFIG_HAVE_CC_STACKPROTECTOR"
check_config_builtin
config="CONFIG_CC_STACKPROTECTOR"
check_config_builtin
config="CONFIG_CC_STACKPROTECTOR_NONE"
check_config_disable
config="CONFIG_CC_STACKPROTECTOR_REGULAR"
check_config_builtin
config="CONFIG_CC_STACKPROTECTOR_STRONG"
check_config_disable
#
# CPU Core family selection
#
config="CONFIG_ARCH_MVEBU"
check_config_disable
config="CONFIG_GPIO_PCA953X"
check_config_module
config="CONFIG_KEYBOARD_GPIO_POLLED"
check_config_module
config="CONFIG_ARCH_HIGHBANK"
check_config_disable
#
# i.MX51 machines:
#
config="CONFIG_MACH_MX51_BABBAGE"
check_config_disable
config="CONFIG_MACH_EUKREA_CPUIMX51SD"
check_config_disable
#
# Device tree only
#
config="CONFIG_SOC_IMX50"
check_config_builtin
config="CONFIG_SOC_IMX6SL"
check_config_builtin
config="CONFIG_SOC_VF610"
check_config_builtin
#
# OMAP Feature Selections
#
config="CONFIG_POWER_AVS_OMAP"
check_config_builtin
config="CONFIG_POWER_AVS_OMAP_CLASS3"
check_config_builtin
config="CONFIG_OMAP_MUX_DEBUG"
check_config_builtin
config="CONFIG_SOC_AM43XX"
check_config_builtin
#
# TI OMAP2/3/4 Specific Features
#
config="CONFIG_SOC_DRA7XX"
check_config_builtin
#
# OMAP Legacy Platform Data Board Type
#
config="CONFIG_MACH_OMAP3_BEAGLE"
check_config_disable
config="CONFIG_MACH_DEVKIT8000"
check_config_disable
config="CONFIG_MACH_OMAP_LDP"
check_config_disable
config="CONFIG_MACH_OMAP3530_LV_SOM"
check_config_disable
config="CONFIG_MACH_OMAP3_TORPEDO"
check_config_disable
config="CONFIG_MACH_OVERO"
check_config_disable
config="CONFIG_MACH_OMAP3517EVM"
check_config_disable
config="CONFIG_MACH_OMAP3_PANDORA"
check_config_disable
config="CONFIG_MACH_TOUCHBOOK"
check_config_disable
config="CONFIG_MACH_OMAP_3430SDP"
check_config_disable
config="CONFIG_MACH_NOKIA_RX51"
check_config_disable
config="CONFIG_MACH_CM_T35"
check_config_disable
config="CONFIG_MACH_CM_T3517"
check_config_disable
config="CONFIG_MACH_SBC3530"
check_config_disable
config="CONFIG_MACH_TI8168EVM"
check_config_disable
config="CONFIG_MACH_TI8148EVM"
check_config_disable
config="CONFIG_ARCH_SOCFPGA"
check_config_disable
config="CONFIG_ARCH_SUNXI"
check_config_disable
config="CONFIG_ARCH_VEXPRESS"
check_config_disable
config="CONFIG_ARCH_VIRT"
check_config_disable
config="CONFIG_ARCH_WM8850"
check_config_disable
#
# Processor Features
#
config="CONFIG_ARM_ERRATA_430973"
check_config_builtin
config="CONFIG_PL310_ERRATA_753970"
check_config_disable
#
# Bus support
#
config="CONFIG_PCI"
check_config_disable
config="CONFIG_PCI_SYSCALL"
check_config_disable
#
# Kernel Features
#
config="CONFIG_ARM_PSCI"
check_config_disable
config="CONFIG_PREEMPT_NONE"
check_config_builtin
config="CONFIG_PREEMPT_VOLUNTARY"
check_config_disable
config="CONFIG_HZ_100"
check_config_builtin
config="CONFIG_HZ_250"
check_config_disable
config="CONFIG_OABI_COMPAT"
check_config_disable
config="CONFIG_HIGHPTE"
check_config_builtin
config="CONFIG_MEMORY_ISOLATION"
check_config_builtin
config="CONFIG_KSM"
check_config_disable
config="CONFIG_CMA"
check_config_builtin
config="CONFIG_CMA_DEBUG"
check_config_disable
config="CONFIG_ZSMALLOC"
check_config_builtin
config="CONFIG_SECCOMP"
check_config_builtin
config="CONFIG_XEN"
check_config_disable
#
# Boot options
#
config="CONFIG_ARM_APPENDED_DTB"
check_config_disable
#
# CPU Frequency scaling
#
config="CONFIG_CPU_FREQ_STAT"
check_config_builtin
config="CONFIG_CPU_FREQ_STAT_DETAILS"
check_config_builtin
config="CONFIG_CPU_FREQ_GOV_POWERSAVE"
check_config_builtin
config="CONFIG_CPU_FREQ_GOV_USERSPACE"
check_config_builtin
config="CONFIG_CPU_FREQ_GOV_ONDEMAND"
check_config_builtin
config="CONFIG_CPU_FREQ_GOV_CONSERVATIVE"
check_config_builtin
config="CONFIG_GENERIC_CPUFREQ_CPU0"
check_config_builtin
#
# ARM CPU frequency scaling drivers
#
config="CONFIG_ARM_IMX6Q_CPUFREQ"
check_config_builtin
#
# CPU Idle
#
config="CONFIG_CPU_IDLE"
check_config_builtin
config="CONFIG_CPU_IDLE_MULTIPLE_DRIVERS"
check_config_builtin
config="CONFIG_CPU_IDLE_GOV_LADDER"
check_config_builtin
config="CONFIG_CPU_IDLE_GOV_MENU"
check_config_builtin
#
# At least one emulation must be selected
#
config="CONFIG_KERNEL_MODE_NEON"
check_config_builtin
#
# Power management options
#
config="CONFIG_PM_AUTOSLEEP"
check_config_builtin
config="CONFIG_PM_WAKELOCKS"
check_config_builtin
config="CONFIG_PM_WAKELOCKS_GC"
check_config_builtin
#
# Networking options
#
config="CONFIG_IPV6_VTI"
check_config_module
config="CONFIG_NETLABEL"
check_config_builtin
#
# Core Netfilter Configuration
#
config="CONFIG_NETFILTER_SYNPROXY"
check_config_module
config="CONFIG_NF_TABLES"
check_config_module
config="CONFIG_NF_TABLES_INET"
check_config_module
config="CONFIG_NFT_EXTHDR"
check_config_module
config="CONFIG_NFT_META"
check_config_module
config="CONFIG_NFT_CT"
check_config_module
config="CONFIG_NFT_RBTREE"
check_config_module
config="CONFIG_NFT_HASH"
check_config_module
config="CONFIG_NFT_COUNTER"
check_config_module
config="CONFIG_NFT_LOG"
check_config_module
config="CONFIG_NFT_LIMIT"
check_config_module
config="CONFIG_NFT_NAT"
check_config_module
config="CONFIG_NFT_QUEUE"
check_config_module
config="CONFIG_NFT_REJECT"
check_config_module
config="CONFIG_NFT_REJECT_INET"
check_config_module
config="CONFIG_NFT_COMPAT"
check_config_module
#
# Xtables matches
#
config="CONFIG_NETFILTER_XT_MATCH_CGROUP"
check_config_module
config="CONFIG_NETFILTER_XT_MATCH_IPCOMP"
check_config_module
#
# Xtables matches
#
config="CONFIG_IP_SET_HASH_NETPORTNET"
check_config_module
config="CONFIG_IP_SET_HASH_NETNET"
check_config_module
#
# IP: Netfilter Configuration
#
config="CONFIG_NF_TABLES_IPV4"
check_config_module
config="CONFIG_NFT_CHAIN_ROUTE_IPV4"
check_config_module
config="CONFIG_NFT_CHAIN_NAT_IPV4"
check_config_disable
config="CONFIG_NFT_REJECT_IPV4"
check_config_module
config="CONFIG_NF_TABLES_ARP"
check_config_module
config="CONFIG_IP_NF_MATCH_ECN"
check_config_module
config="CONFIG_IP_NF_MATCH_TTL"
check_config_module
config="CONFIG_IP_NF_TARGET_SYNPROXY"
check_config_module
config="CONFIG_IP_NF_TARGET_NETMAP"
check_config_module
config="CONFIG_IP_NF_TARGET_REDIRECT"
check_config_module
#
# IPv6: Netfilter Configuration
#
config="CONFIG_NF_TABLES_IPV6"
check_config_module
config="CONFIG_NFT_CHAIN_ROUTE_IPV6"
check_config_module
config="CONFIG_NFT_CHAIN_NAT_IPV6"
check_config_disable
config="CONFIG_NFT_REJECT_IPV6"
check_config_module
config="CONFIG_IP6_NF_TARGET_SYNPROXY"
check_config_module
config="CONFIG_NF_TABLES_BRIDGE"
check_config_module
#
# DCCP Kernel Hacking
#
config="CONFIG_6LOWPAN_IPHC"
check_config_module
config="CONFIG_MAC802154"
check_config_module
#
# Queueing/Scheduling
#
config="CONFIG_NET_SCH_HHF"
check_config_module
config="CONFIG_NET_SCH_PIE"
check_config_module
#
# Classification
#
config="CONFIG_NET_CLS_BPF"
check_config_module
config="CONFIG_HSR"
check_config_module
config="CONFIG_CGROUP_NET_PRIO"
check_config_module
config="CONFIG_CGROUP_NET_CLASSID"
check_config_builtin
#
# CAN USB interfaces
#
config="CONFIG_IRDA"
check_config_module
#
# IrDA protocols
#
config="CONFIG_IRLAN"
check_config_module
config="CONFIG_IRNET"
check_config_disable
config="CONFIG_IRCOMM"
check_config_module
config="CONFIG_IRDA_ULTRA"
check_config_builtin
#
# IrDA options
#
config="CONFIG_IRDA_CACHE_LAST_LSAP"
check_config_builtin
config="CONFIG_IRDA_FAST_RR"
check_config_builtin
config="CONFIG_IRDA_DEBUG"
check_config_builtin
#
# Infrared-port device drivers
#
#
# SIR device drivers
#
config="CONFIG_IRTTY_SIR"
check_config_module
#
# Dongle support
#
config="CONFIG_DONGLE"
check_config_builtin
config="CONFIG_ESI_DONGLE"
check_config_module
config="CONFIG_ACTISYS_DONGLE"
check_config_module
config="CONFIG_TEKRAM_DONGLE"
check_config_module
config="CONFIG_TOIM3232_DONGLE"
check_config_module
config="CONFIG_LITELINK_DONGLE"
check_config_module
config="CONFIG_MA600_DONGLE"
check_config_module
config="CONFIG_GIRBIL_DONGLE"
check_config_module
config="CONFIG_MCP2120_DONGLE"
check_config_module
config="CONFIG_OLD_BELKIN_DONGLE"
check_config_module
config="CONFIG_ACT200L_DONGLE"
check_config_module
config="CONFIG_KINGSUN_DONGLE"
check_config_module
config="CONFIG_KSDAZZLE_DONGLE"
check_config_module
config="CONFIG_KS959_DONGLE"
check_config_module
#
# FIR device drivers
#
config="CONFIG_USB_IRDA"
check_config_module
config="CONFIG_SIGMATEL_FIR"
check_config_module
config="CONFIG_MCS_FIR"
check_config_module
#
# Bluetooth device drivers
#
config="CONFIG_BT_HCIUART"
check_config_module
config="CONFIG_BT_HCIUART_H4"
check_config_builtin
config="CONFIG_BT_HCIUART_BCSP"
check_config_builtin
config="CONFIG_BT_HCIUART_ATH3K"
check_config_builtin
config="CONFIG_BT_HCIUART_LL"
check_config_builtin
config="CONFIG_BT_HCIUART_3WIRE"
check_config_builtin
config="CONFIG_MAC80211_RC_PID"
check_config_builtin
config="CONFIG_NFC_DIGITAL"
check_config_module
config="CONFIG_NFC_NCI_SPI"
check_config_builtin
config="CONFIG_NFC_HCI"
check_config_module
config="CONFIG_NFC_SHDLC"
check_config_builtin
#
# Near Field Communication (NFC) devices
#
config="CONFIG_NFC_WILINK"
check_config_module
config="CONFIG_NFC_PORT100"
check_config_module
config="CONFIG_NFC_PN544"
check_config_module
config="CONFIG_NFC_PN544_I2C"
check_config_module
config="CONFIG_NFC_MICROREAD"
check_config_module
config="CONFIG_NFC_MICROREAD_I2C"
check_config_module
config="CONFIG_NFC_MRVL"
check_config_module
#
# Generic Driver Options
#
config="CONFIG_DEVTMPFS_MOUNT"
check_config_builtin
#
# Bus devices
#
config="CONFIG_IMX_WEIM"
check_config_builtin
config="CONFIG_OMAP_OCP2SCP"
check_config_builtin
#
# RAM/ROM/Flash chip drivers
#
config="CONFIG_MTD_CFI"
check_config_builtin
config="CONFIG_MTD_JEDECPROBE"
check_config_builtin
config="CONFIG_MTD_GEN_PROBE"
check_config_builtin
config="CONFIG_MTD_CFI_ADV_OPTIONS"
check_config_disable
config="CONFIG_MTD_CFI_INTELEXT"
check_config_builtin
config="CONFIG_MTD_CFI_AMDSTD"
check_config_builtin
config="CONFIG_MTD_CFI_STAA"
check_config_builtin
config="CONFIG_MTD_CFI_UTIL"
check_config_builtin
#
# Mapping drivers for chip access
#
config="CONFIG_MTD_PHYSMAP"
check_config_disable
config="CONFIG_MTD_PHYSMAP_OF"
check_config_builtin
config="CONFIG_MTD_IMPA7"
check_config_disable
config="CONFIG_MTD_PLATRAM"
check_config_disable
#
# Self-contained MTD device drivers
#
config="CONFIG_MTD_DATAFLASH"
check_config_builtin
config="CONFIG_MTD_M25P80"
check_config_builtin
config="CONFIG_MTD_SST25L"
check_config_builtin
#
# Disk-On-Chip Device Drivers
#
config="CONFIG_MTD_NAND"
check_config_disable
config="CONFIG_MTD_ONENAND"
check_config_disable
#
# LPDDR flash memory drivers
#
config="CONFIG_MTD_LPDDR"
check_config_disable
config="CONFIG_MTD_UBI"
check_config_disable
#
# Device Tree and Open Firmware support
#
config="CONFIG_PARPORT"
check_config_disable
config="CONFIG_ZRAM"
check_config_module
config="CONFIG_ZRAM_DEBUG"
check_config_disable
config="CONFIG_BLK_DEV_RAM_SIZE"
value="4096"
check_config_value
config="CONFIG_VIRTIO_BLK"
check_config_disable
#
# Misc devices
#
config="CONFIG_AD525X_DPOT"
check_config_disable
config="CONFIG_ICS932S401"
check_config_disable
config="CONFIG_ENCLOSURE_SERVICES"
check_config_disable
config="CONFIG_APDS9802ALS"
check_config_disable
config="CONFIG_ISL29003"
check_config_disable
config="CONFIG_ISL29020"
check_config_disable
config="CONFIG_SENSORS_TSL2550"
check_config_disable
config="CONFIG_SENSORS_BH1780"
check_config_disable
config="CONFIG_SENSORS_BH1770"
check_config_disable
config="CONFIG_SENSORS_APDS990X"
check_config_disable
config="CONFIG_HMC6352"
check_config_disable
config="CONFIG_DS1682"
check_config_disable
config="CONFIG_TI_DAC7512"
check_config_disable
config="CONFIG_BMP085_I2C"
check_config_disable
config="CONFIG_SRAM"
check_config_builtin
config="CONFIG_C2PORT"
check_config_disable
#
# EEPROM support
#
config="CONFIG_EEPROM_AT24"
check_config_builtin
config="CONFIG_EEPROM_AT25"
check_config_builtin
config="CONFIG_EEPROM_93CX6"
check_config_builtin
config="CONFIG_EEPROM_93XX46"
check_config_module
#
# Texas Instruments shared transport line discipline
#
config="CONFIG_SENSORS_LIS3_SPI"
check_config_module
#
# SCSI device support
#
config="CONFIG_SCSI_MOD"
check_config_builtin
config="CONFIG_RAID_ATTRS"
check_config_disable
config="CONFIG_SCSI"
check_config_builtin
config="CONFIG_SCSI_TGT"
check_config_disable
config="CONFIG_SCSI_NETLINK"
check_config_disable
config="CONFIG_SCSI_PROC_FS"
check_config_builtin
#
# SCSI support type (disk, tape, CD-ROM)
#
config="CONFIG_BLK_DEV_SD"
check_config_builtin
config="CONFIG_CHR_DEV_ST"
check_config_disable
config="CONFIG_CHR_DEV_OSST"
check_config_disable
config="CONFIG_BLK_DEV_SR"
check_config_disable
config="CONFIG_CHR_DEV_SG"
check_config_disable
config="CONFIG_CHR_DEV_SCH"
check_config_disable
config="CONFIG_SCSI_MULTI_LUN"
check_config_disable
config="CONFIG_SCSI_CONSTANTS"
check_config_disable
config="CONFIG_SCSI_LOGGING"
check_config_disable
config="CONFIG_SCSI_SCAN_ASYNC"
check_config_disable
#
# SCSI Transports
#
config="CONFIG_SCSI_SPI_ATTRS"
check_config_disable
config="CONFIG_SCSI_FC_ATTRS"
check_config_disable
config="CONFIG_SCSI_ISCSI_ATTRS"
check_config_disable
config="CONFIG_SCSI_SAS_ATTRS"
check_config_disable
config="CONFIG_SCSI_SAS_LIBSAS"
check_config_disable
config="CONFIG_SCSI_SRP_ATTRS"
check_config_disable
config="CONFIG_ISCSI_TCP"
check_config_disable
config="CONFIG_ISCSI_BOOT_SYSFS"
check_config_disable
config="CONFIG_SCSI_UFSHCD"
check_config_disable
config="CONFIG_LIBFC"
check_config_disable
config="CONFIG_LIBFCOE"
check_config_disable
config="CONFIG_SCSI_VIRTIO"
check_config_disable
config="CONFIG_SCSI_DH"
check_config_disable
config="CONFIG_SCSI_OSD_INITIATOR"
check_config_disable
config="CONFIG_ATA"
check_config_builtin
#
# Controllers with non-SFF native interface
#
config="CONFIG_SATA_AHCI_PLATFORM"
check_config_builtin
config="CONFIG_AHCI_IMX"
check_config_builtin
#
# SATA SFF controllers with BMDMA
#
config="CONFIG_SATA_HIGHBANK"
check_config_builtin
config="CONFIG_SATA_MV"
check_config_builtin
#
# PATA SFF controllers with BMDMA
#
config="CONFIG_PATA_IMX"
check_config_disable
#
# PIO-only SFF controllers
#
config="CONFIG_PATA_PLATFORM"
check_config_disable
#
# Generic fallback / legacy drivers
#
config="CONFIG_MII"
check_config_builtin
#
# Distributed Switch Architecture drivers
#
config="CONFIG_NET_VENDOR_ARC"
check_config_builtin
config="CONFIG_ARC_EMAC"
check_config_disable
config="CONFIG_NET_CALXEDA_XGMAC"
check_config_builtin
config="CONFIG_MVMDIO"
check_config_disable
config="CONFIG_KS8851"
check_config_module
config="CONFIG_ENC28J60"
check_config_disable
config="CONFIG_NET_VENDOR_SEEQ"
check_config_builtin
config="CONFIG_SMC91X"
check_config_disable
config="CONFIG_SMC911X"
check_config_disable
config="CONFIG_SMSC911X"
check_config_builtin
config="CONFIG_STMMAC_ETH"
check_config_builtin
config="CONFIG_STMMAC_PLATFORM"
check_config_builtin
config="CONFIG_STMMAC_DEBUG_FS"
check_config_disable
config="CONFIG_STMMAC_DA"
check_config_disable
config="CONFIG_TI_DAVINCI_EMAC"
check_config_builtin
config="CONFIG_TI_DAVINCI_MDIO"
check_config_builtin
config="CONFIG_TI_DAVINCI_CPDMA"
check_config_builtin
config="CONFIG_TI_CPSW"
check_config_disable
config="CONFIG_VIA_VELOCITY"
check_config_disable
#
# USB Network Adapters
#
config="CONFIG_USB_NET_HUAWEI_CDC_NCM"
check_config_module
config="CONFIG_USB_NET_SR9800"
check_config_module
config="CONFIG_USB_ZD1201"
check_config_module
config="CONFIG_WCN36XX"
check_config_module
config="CONFIG_WCN36XX_DEBUGFS"
check_config_disable
config="CONFIG_BRCMFMAC"
check_config_module
config="CONFIG_BRCMFMAC_SDIO"
check_config_builtin
config="CONFIG_BRCMFMAC_USB"
check_config_disable
config="CONFIG_BRCMDBG"
check_config_builtin
config="CONFIG_LIBERTAS_SPI"
check_config_module
config="CONFIG_P54_SPI"
check_config_module
config="CONFIG_P54_SPI_DEFAULT_EEPROM"
check_config_disable
config="CONFIG_WL_TI"
check_config_builtin
config="CONFIG_WL1251"
check_config_module
config="CONFIG_WL1251_SPI"
check_config_module
config="CONFIG_WL1251_SDIO"
check_config_module
config="CONFIG_WL12XX"
check_config_module
config="CONFIG_WL18XX"
check_config_module
config="CONFIG_WLCORE"
check_config_module
config="CONFIG_WLCORE_SPI"
check_config_module
config="CONFIG_WLCORE_SDIO"
check_config_module
config="CONFIG_WILINK_PLATFORM_DATA"
check_config_builtin
config="CONFIG_MWIFIEX"
check_config_module
config="CONFIG_MWIFIEX_SDIO"
check_config_module
config="CONFIG_MWIFIEX_USB"
check_config_module
#
# WiMAX Wireless Broadband devices
#
config="CONFIG_IEEE802154_FAKELB"
check_config_module
config="CONFIG_IEEE802154_AT86RF230"
check_config_module
config="CONFIG_IEEE802154_MRF24J40"
check_config_module
#
# Input Device Drivers
#
config="CONFIG_KEYBOARD_ADP5589"
check_config_module
config="CONFIG_KEYBOARD_ATKBD"
check_config_module
config="CONFIG_KEYBOARD_QT1070"
check_config_module
config="CONFIG_KEYBOARD_LKKBD"
check_config_module
config="CONFIG_KEYBOARD_GPIO"
check_config_module
config="CONFIG_KEYBOARD_TCA6416"
check_config_module
config="CONFIG_KEYBOARD_TCA8418"
check_config_module
config="CONFIG_KEYBOARD_MATRIX"
check_config_module
config="CONFIG_KEYBOARD_LM8333"
check_config_module
config="CONFIG_KEYBOARD_MCS"
check_config_module
config="CONFIG_KEYBOARD_MPR121"
check_config_module
config="CONFIG_KEYBOARD_NEWTON"
check_config_module
config="CONFIG_KEYBOARD_SAMSUNG"
check_config_module
config="CONFIG_KEYBOARD_SUNKBD"
check_config_module
config="CONFIG_KEYBOARD_XTKBD"
check_config_module
config="CONFIG_MOUSE_PS2_TOUCHKIT"
check_config_builtin
config="CONFIG_MOUSE_SERIAL"
check_config_module
config="CONFIG_MOUSE_BCM5974"
check_config_module
config="CONFIG_MOUSE_CYAPA"
check_config_module
config="CONFIG_MOUSE_VSXXXAA"
check_config_module
config="CONFIG_MOUSE_GPIO"
check_config_module
config="CONFIG_INPUT_JOYSTICK"
check_config_builtin
config="CONFIG_JOYSTICK_ANALOG"
check_config_module
config="CONFIG_JOYSTICK_A3D"
check_config_module
config="CONFIG_JOYSTICK_ADI"
check_config_module
config="CONFIG_JOYSTICK_COBRA"
check_config_module
config="CONFIG_JOYSTICK_GF2K"
check_config_module
config="CONFIG_JOYSTICK_GRIP"
check_config_module
config="CONFIG_JOYSTICK_GRIP_MP"
check_config_module
config="CONFIG_JOYSTICK_GUILLEMOT"
check_config_module
config="CONFIG_JOYSTICK_INTERACT"
check_config_module
config="CONFIG_JOYSTICK_SIDEWINDER"
check_config_module
config="CONFIG_JOYSTICK_TMDC"
check_config_module
config="CONFIG_JOYSTICK_IFORCE"
check_config_module
config="CONFIG_JOYSTICK_IFORCE_USB"
check_config_builtin
config="CONFIG_JOYSTICK_IFORCE_232"
check_config_builtin
config="CONFIG_JOYSTICK_WARRIOR"
check_config_module
config="CONFIG_JOYSTICK_MAGELLAN"
check_config_module
config="CONFIG_JOYSTICK_SPACEORB"
check_config_module
config="CONFIG_JOYSTICK_SPACEBALL"
check_config_module
config="CONFIG_JOYSTICK_STINGER"
check_config_module
config="CONFIG_JOYSTICK_TWIDJOY"
check_config_module
config="CONFIG_JOYSTICK_ZHENHUA"
check_config_module
config="CONFIG_JOYSTICK_AS5011"
check_config_module
config="CONFIG_JOYSTICK_JOYDUMP"
check_config_module
config="CONFIG_JOYSTICK_XPAD"
check_config_module
config="CONFIG_JOYSTICK_XPAD_FF"
check_config_builtin
config="CONFIG_JOYSTICK_XPAD_LEDS"
check_config_builtin
config="CONFIG_TOUCHSCREEN_AD7879_SPI"
check_config_module
config="CONFIG_TOUCHSCREEN_AUO_PIXCIR"
check_config_module
config="CONFIG_TOUCHSCREEN_BU21013"
check_config_module
config="CONFIG_TOUCHSCREEN_CY8CTMG110"
check_config_module
config="CONFIG_TOUCHSCREEN_CYTTSP_CORE"
check_config_module
config="CONFIG_TOUCHSCREEN_CYTTSP_I2C"
check_config_module
config="CONFIG_TOUCHSCREEN_CYTTSP_SPI"
check_config_module
config="CONFIG_TOUCHSCREEN_CYTTSP4_CORE"
check_config_module
config="CONFIG_TOUCHSCREEN_CYTTSP4_I2C"
check_config_module
config="CONFIG_TOUCHSCREEN_CYTTSP4_SPI"
check_config_module
config="CONFIG_TOUCHSCREEN_DA9052"
check_config_module
config="CONFIG_TOUCHSCREEN_EETI"
check_config_module
config="CONFIG_TOUCHSCREEN_EGALAX"
check_config_module
config="CONFIG_TOUCHSCREEN_ILI210X"
check_config_module
config="CONFIG_TOUCHSCREEN_WACOM_I2C"
check_config_module
config="CONFIG_TOUCHSCREEN_MAX11801"
check_config_module
config="CONFIG_TOUCHSCREEN_MMS114"
check_config_module
config="CONFIG_TOUCHSCREEN_EDT_FT5X06"
check_config_module
config="CONFIG_TOUCHSCREEN_TI_AM335X_TSC"
check_config_module
config="CONFIG_TOUCHSCREEN_PIXCIR"
check_config_module
config="CONFIG_TOUCHSCREEN_TSC_SERIO"
check_config_module
config="CONFIG_TOUCHSCREEN_ST1232"
check_config_module
config="CONFIG_TOUCHSCREEN_SUR40"
check_config_module
config="CONFIG_TOUCHSCREEN_ZFORCE"
check_config_module
config="CONFIG_INPUT_AD714X"
check_config_module
config="CONFIG_INPUT_AD714X_I2C"
check_config_module
config="CONFIG_INPUT_AD714X_SPI"
check_config_module
config="CONFIG_INPUT_BMA150"
check_config_module
config="CONFIG_INPUT_MC13783_PWRBUTTON"
check_config_module
config="CONFIG_INPUT_MPU3050"
check_config_module
config="CONFIG_INPUT_GP2A"
check_config_module
config="CONFIG_INPUT_GPIO_TILT_POLLED"
check_config_module
config="CONFIG_INPUT_KXTJ9"
check_config_module
config="CONFIG_INPUT_KXTJ9_POLLED_MODE"
check_config_builtin
config="CONFIG_INPUT_TWL4030_PWRBUTTON"
check_config_builtin
config="CONFIG_INPUT_TWL4030_VIBRA"
check_config_builtin
config="CONFIG_INPUT_TWL6040_VIBRA"
check_config_builtin
config="CONFIG_INPUT_UINPUT"
check_config_builtin
config="CONFIG_INPUT_PCF8574"
check_config_module
config="CONFIG_INPUT_GPIO_ROTARY_ENCODER"
check_config_module
config="CONFIG_INPUT_DA9052_ONKEY"
check_config_module
config="CONFIG_INPUT_DA9055_ONKEY"
check_config_module
config="CONFIG_INPUT_ADXL34X"
check_config_module
config="CONFIG_INPUT_ADXL34X_I2C"
check_config_module
config="CONFIG_INPUT_ADXL34X_SPI"
check_config_module
config="CONFIG_INPUT_IMS_PCU"
check_config_module
config="CONFIG_INPUT_CMA3000"
check_config_module
config="CONFIG_INPUT_CMA3000_I2C"
check_config_module
#
# Hardware I/O ports
#
config="CONFIG_SERIO_ALTERA_PS2"
check_config_disable
#
# Character devices
#
config="CONFIG_DEVPTS_MULTIPLE_INSTANCES"
check_config_disable
config="CONFIG_LEGACY_PTYS"
check_config_builtin
config="CONFIG_N_GSM"
check_config_disable
config="CONFIG_DEVKMEM"
check_config_builtin
#
# Non-8250 serial port support
#
config="CONFIG_CONSOLE_POLL"
check_config_builtin
config="CONFIG_SERIAL_OF_PLATFORM"
check_config_builtin
config="CONFIG_SERIAL_OMAP"
check_config_builtin
config="CONFIG_SERIAL_OMAP_CONSOLE"
check_config_builtin
config="CONFIG_SERIAL_ARC"
check_config_disable
config="CONFIG_SERIAL_FSL_LPUART"
check_config_builtin
config="CONFIG_SERIAL_FSL_LPUART_CONSOLE"
check_config_builtin
config="CONFIG_VIRTIO_CONSOLE"
check_config_disable
config="CONFIG_HW_RANDOM"
check_config_builtin
config="CONFIG_HW_RANDOM_OMAP"
check_config_builtin
config="CONFIG_HW_RANDOM_OMAP3_ROM"
check_config_builtin
config="CONFIG_HW_RANDOM_VIRTIO"
check_config_disable
config="CONFIG_I2C_CHARDEV"
check_config_builtin
config="CONFIG_I2C_SMBUS"
check_config_module
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
config="CONFIG_I2C_DESIGNWARE_CORE"
check_config_builtin
config="CONFIG_I2C_DESIGNWARE_PLATFORM"
check_config_builtin
config="CONFIG_I2C_IMX"
check_config_builtin
config="CONFIG_I2C_OCORES"
check_config_disable
config="CONFIG_I2C_PCA_PLATFORM"
check_config_disable
config="CONFIG_I2C_SIMTEC"
check_config_disable
#
# External I2C/SMBus adapter drivers
#
config="CONFIG_I2C_PARPORT_LIGHT"
check_config_module
#
# SPI Master Controller Drivers
#
config="CONFIG_SPI_IMX"
check_config_builtin
config="CONFIG_SPI_OMAP24XX"
check_config_builtin
#
# Pin controllers
#
config="CONFIG_PINCTRL_SINGLE"
check_config_builtin
config="CONFIG_PINCTRL_PALMAS"
check_config_builtin
config="CONFIG_GPIO_DA9052"
check_config_builtin
config="CONFIG_GPIO_DA9055"
check_config_module
config="CONFIG_GPIO_MAX730X"
check_config_module
#
# I2C GPIO expanders:
#
config="CONFIG_GPIO_MAX7300"
check_config_module
config="CONFIG_GPIO_MAX732X"
check_config_module
config="CONFIG_GPIO_PCF857X"
check_config_module
config="CONFIG_GPIO_SX150X"
check_config_builtin
config="CONFIG_GPIO_ADP5588"
check_config_module
config="CONFIG_GPIO_ADNP"
check_config_module
#
# SPI GPIO expanders:
#
config="CONFIG_GPIO_MAX7301"
check_config_module
config="CONFIG_GPIO_MCP23S08"
check_config_module
config="CONFIG_GPIO_MC33880"
check_config_module
config="CONFIG_GPIO_74X164"
check_config_module
#
# MODULbus GPIO expanders:
#
config="CONFIG_GPIO_PALMAS"
check_config_builtin
config="CONFIG_GPIO_TPS65910"
check_config_builtin
#
# 1-wire Bus Masters
#
config="CONFIG_W1_MASTER_MXC"
check_config_module
config="CONFIG_W1_MASTER_DS1WM"
check_config_module
config="CONFIG_W1_MASTER_GPIO"
check_config_module
config="CONFIG_HDQ_MASTER_OMAP"
check_config_module
#
# 1-wire Slaves
#
config="CONFIG_W1_SLAVE_DS2408"
check_config_module
config="CONFIG_W1_SLAVE_DS2408_READBACK"
check_config_builtin
config="CONFIG_W1_SLAVE_DS2413"
check_config_module
config="CONFIG_W1_SLAVE_DS2423"
check_config_module
config="CONFIG_W1_SLAVE_DS2433_CRC"
check_config_builtin
config="CONFIG_W1_SLAVE_DS2760"
check_config_module
config="CONFIG_W1_SLAVE_DS2780"
check_config_module
config="CONFIG_W1_SLAVE_DS2781"
check_config_module
config="CONFIG_W1_SLAVE_DS28E04"
check_config_module
config="CONFIG_GENERIC_ADC_BATTERY"
check_config_module
config="CONFIG_BATTERY_BQ27x00"
check_config_disable
config="CONFIG_BATTERY_DA9052"
check_config_module
config="CONFIG_BATTERY_TWL4030_MADC"
check_config_disable
config="CONFIG_BATTERY_RX51"
check_config_disable
config="CONFIG_CHARGER_ISP1704"
check_config_disable
config="CONFIG_CHARGER_GPIO"
check_config_module
config="CONFIG_POWER_RESET_GPIO"
check_config_disable
config="CONFIG_POWER_RESET_RESTART"
check_config_disable
config="CONFIG_POWER_AVS"
check_config_builtin
#
# Native drivers
#
config="CONFIG_SENSORS_AD7314"
check_config_module
config="CONFIG_SENSORS_ADM1021"
check_config_module
config="CONFIG_SENSORS_ADM1025"
check_config_module
config="CONFIG_SENSORS_ADM1026"
check_config_module
config="CONFIG_SENSORS_ADM1031"
check_config_module
config="CONFIG_SENSORS_ADT7X10"
check_config_module
config="CONFIG_SENSORS_ADT7310"
check_config_module
config="CONFIG_SENSORS_ADT7410"
check_config_module
config="CONFIG_SENSORS_DS1621"
check_config_module
config="CONFIG_SENSORS_DA9052_ADC"
check_config_module
config="CONFIG_SENSORS_DA9055"
check_config_module
config="CONFIG_SENSORS_F71805F"
check_config_module
config="CONFIG_SENSORS_G762"
check_config_module
config="CONFIG_SENSORS_GL518SM"
check_config_module
config="CONFIG_SENSORS_GL520SM"
check_config_module
config="CONFIG_SENSORS_GPIO_FAN"
check_config_module
config="CONFIG_SENSORS_HIH6130"
check_config_module
config="CONFIG_SENSORS_HTU21"
check_config_module
config="CONFIG_SENSORS_IIO_HWMON"
check_config_module
config="CONFIG_SENSORS_IT87"
check_config_module
config="CONFIG_SENSORS_LM63"
check_config_module
config="CONFIG_SENSORS_LM75"
check_config_module
config="CONFIG_SENSORS_LM77"
check_config_module
config="CONFIG_SENSORS_LM78"
check_config_module
config="CONFIG_SENSORS_LM80"
check_config_module
config="CONFIG_SENSORS_LM83"
check_config_module
config="CONFIG_SENSORS_LM85"
check_config_module
config="CONFIG_SENSORS_LM87"
check_config_module
config="CONFIG_SENSORS_LM90"
check_config_module
config="CONFIG_SENSORS_LM92"
check_config_module
config="CONFIG_SENSORS_LM95234"
check_config_module
config="CONFIG_SENSORS_MAX1619"
check_config_module
config="CONFIG_SENSORS_MAX197"
check_config_module
config="CONFIG_SENSORS_MAX6697"
check_config_module
config="CONFIG_SENSORS_MCP3021"
check_config_module
config="CONFIG_SENSORS_PC87360"
check_config_module
config="CONFIG_SENSORS_PCF8591"
check_config_module
config="CONFIG_PMBUS"
check_config_module
config="CONFIG_SENSORS_PMBUS"
check_config_module
config="CONFIG_SENSORS_ADM1275"
check_config_module
config="CONFIG_SENSORS_LM25066"
check_config_module
config="CONFIG_SENSORS_LTC2978"
check_config_module
config="CONFIG_SENSORS_MAX16064"
check_config_module
config="CONFIG_SENSORS_MAX34440"
check_config_module
config="CONFIG_SENSORS_MAX8688"
check_config_module
config="CONFIG_SENSORS_UCD9000"
check_config_module
config="CONFIG_SENSORS_UCD9200"
check_config_module
config="CONFIG_SENSORS_ZL6100"
check_config_module
config="CONFIG_SENSORS_SHT15"
check_config_module
config="CONFIG_SENSORS_SMSC47M1"
check_config_module
config="CONFIG_SENSORS_SMSC47B397"
check_config_module
config="CONFIG_SENSORS_SCH5636"
check_config_module
config="CONFIG_SENSORS_INA209"
check_config_module
config="CONFIG_SENSORS_INA2XX"
check_config_module
config="CONFIG_SENSORS_TWL4030_MADC"
check_config_module
config="CONFIG_SENSORS_W83781D"
check_config_module
config="CONFIG_SENSORS_W83L785TS"
check_config_module
config="CONFIG_SENSORS_W83627HF"
check_config_module
config="CONFIG_THERMAL_GOV_FAIR_SHARE"
check_config_disable
config="CONFIG_IMX_THERMAL"
check_config_builtin
#
# Texas Instruments thermal drivers
#
config="CONFIG_TI_SOC_THERMAL"
check_config_builtin
config="CONFIG_TI_THERMAL"
check_config_builtin
config="CONFIG_OMAP4_THERMAL"
check_config_builtin
config="CONFIG_OMAP5_THERMAL"
check_config_builtin
config="CONFIG_DRA752_THERMAL"
check_config_builtin
config="CONFIG_WATCHDOG_NOWAYOUT"
check_config_builtin
#
# Watchdog Device Drivers
#
config="CONFIG_SOFT_WATCHDOG"
check_config_disable
config="CONFIG_DA9052_WATCHDOG"
check_config_builtin
config="CONFIG_DA9055_WATCHDOG"
check_config_disable
config="CONFIG_OMAP_WATCHDOG"
check_config_builtin
config="CONFIG_TWL4030_WATCHDOG"
check_config_builtin
config="CONFIG_IMX2_WDT"
check_config_builtin
#
# USB-based Watchdog Cards
#
config="CONFIG_USBPCWATCHDOG"
check_config_module
#
# Multifunction device drivers
#
config="CONFIG_MFD_DA9055"
check_config_builtin
config="CONFIG_MFD_DA9063"
check_config_builtin
config="CONFIG_MFD_MC13XXX"
check_config_builtin
config="CONFIG_MFD_MC13XXX_SPI"
check_config_builtin
config="CONFIG_MFD_MC13XXX_I2C"
check_config_builtin
config="CONFIG_MFD_TI_AM335X_TSCADC"
check_config_builtin
config="CONFIG_MFD_PALMAS"
check_config_builtin
config="CONFIG_MFD_TPS65217"
check_config_builtin
config="CONFIG_MFD_TPS65910"
check_config_builtin
config="CONFIG_TWL4030_MADC"
check_config_builtin
config="CONFIG_MFD_WL1273_CORE"
check_config_module
config="CONFIG_VEXPRESS_CONFIG"
check_config_disable
config="CONFIG_REGULATOR_VIRTUAL_CONSUMER"
check_config_builtin
config="CONFIG_REGULATOR_USERSPACE_CONSUMER"
check_config_builtin
config="CONFIG_REGULATOR_ANATOP"
check_config_builtin
config="CONFIG_REGULATOR_DA9052"
check_config_builtin
config="CONFIG_REGULATOR_DA9055"
check_config_disable
config="CONFIG_REGULATOR_DA9063"
check_config_disable
config="CONFIG_REGULATOR_GPIO"
check_config_builtin
config="CONFIG_REGULATOR_MC13XXX_CORE"
check_config_builtin
config="CONFIG_REGULATOR_MC13783"
check_config_builtin
config="CONFIG_REGULATOR_MC13892"
check_config_builtin
config="CONFIG_REGULATOR_PALMAS"
check_config_builtin
config="CONFIG_REGULATOR_TI_ABB"
check_config_builtin
config="CONFIG_REGULATOR_TPS65023"
check_config_builtin
config="CONFIG_REGULATOR_TPS6507X"
check_config_builtin
config="CONFIG_REGULATOR_TPS65217"
check_config_builtin
config="CONFIG_REGULATOR_TPS65910"
check_config_builtin
#
# Multimedia core support
#
config="CONFIG_VIDEO_V4L2_SUBDEV_API"
check_config_builtin
config="CONFIG_V4L2_MEM2MEM_DEV"
check_config_builtin
config="CONFIG_VIDEOBUF2_CORE"
check_config_builtin
config="CONFIG_VIDEOBUF2_MEMOPS"
check_config_builtin
config="CONFIG_VIDEOBUF2_DMA_CONTIG"
check_config_builtin
#
# Media drivers
#
config="CONFIG_IR_GPIO_CIR"
check_config_module
#
# Analog/digital TV USB devices
#
config="CONFIG_VIDEO_TM6000"
check_config_module
config="CONFIG_VIDEO_TM6000_ALSA"
check_config_module
config="CONFIG_VIDEO_TM6000_DVB"
check_config_module
#
# Webcam, TV (analog/digital) USB devices
#
config="CONFIG_VIDEO_OMAP3"
check_config_module
config="CONFIG_VIDEO_OMAP3_DEBUG"
check_config_disable
config="CONFIG_SOC_CAMERA"
check_config_module
config="CONFIG_SOC_CAMERA_PLATFORM"
check_config_module
config="CONFIG_VIDEO_RCAR_VIN"
check_config_disable
config="CONFIG_VIDEO_SH_MOBILE_CSI2"
check_config_disable
config="CONFIG_VIDEO_SH_MOBILE_CEU"
check_config_disable
config="CONFIG_VIDEO_CODA"
check_config_builtin
config="CONFIG_VIDEO_MEM2MEM_DEINTERLACE"
check_config_module
config="CONFIG_VIDEO_VIVI"
check_config_disable
#
# Supported MMC/SDIO adapters
#
config="CONFIG_I2C_SI470X"
check_config_module
config="CONFIG_USB_DSBR"
check_config_module
config="CONFIG_RADIO_TEA5764"
check_config_module
config="CONFIG_RADIO_SAA7706H"
check_config_module
config="CONFIG_RADIO_TEF6862"
check_config_module
config="CONFIG_RADIO_WL1273"
check_config_module
#
# soc_camera sensor drivers
#
config="CONFIG_SOC_CAMERA_IMX074"
check_config_module
config="CONFIG_SOC_CAMERA_MT9M001"
check_config_module
config="CONFIG_SOC_CAMERA_MT9M111"
check_config_module
config="CONFIG_SOC_CAMERA_MT9T031"
check_config_module
config="CONFIG_SOC_CAMERA_MT9T112"
check_config_module
config="CONFIG_SOC_CAMERA_MT9V022"
check_config_module
config="CONFIG_SOC_CAMERA_OV2640"
check_config_module
config="CONFIG_SOC_CAMERA_OV5642"
check_config_module
config="CONFIG_SOC_CAMERA_OV6650"
check_config_module
config="CONFIG_SOC_CAMERA_OV772X"
check_config_module
config="CONFIG_SOC_CAMERA_OV9640"
check_config_module
config="CONFIG_SOC_CAMERA_OV9740"
check_config_module
config="CONFIG_SOC_CAMERA_RJ54N1"
check_config_module
config="CONFIG_SOC_CAMERA_TW9910"
check_config_module
#
# Graphics support
#
config="CONFIG_DRM"
check_config_builtin
config="CONFIG_DRM_USB"
check_config_builtin
config="CONFIG_DRM_KMS_HELPER"
check_config_builtin
config="CONFIG_DRM_KMS_FB_HELPER"
check_config_builtin
config="CONFIG_DRM_LOAD_EDID_FIRMWARE"
check_config_disable
config="CONFIG_DRM_GEM_CMA_HELPER"
check_config_builtin
config="CONFIG_DRM_KMS_CMA_HELPER"
check_config_builtin
#
# I2C encoder or helper chips
#
config="CONFIG_DRM_I2C_CH7006"
check_config_builtin
config="CONFIG_DRM_I2C_SIL164"
check_config_builtin
config="CONFIG_DRM_I2C_NXP_TDA998X"
check_config_builtin
config="CONFIG_DRM_VIVANTE"
check_config_module
config="CONFIG_DRM_EXYNOS"
check_config_disable
config="CONFIG_DRM_UDL"
check_config_builtin
config="CONFIG_DRM_ARMADA"
check_config_disable
config="CONFIG_DRM_RCAR_DU"
check_config_disable
config="CONFIG_DRM_SHMOBILE"
check_config_disable
config="CONFIG_DRM_OMAP"
check_config_builtin
config="CONFIG_DRM_TILCDC"
check_config_builtin
config="CONFIG_VIDEO_OUTPUT_CONTROL"
check_config_disable
config="CONFIG_HDMI"
check_config_builtin
config="CONFIG_FIRMWARE_EDID"
check_config_disable
config="CONFIG_FB_CFB_FILLRECT"
check_config_disable
config="CONFIG_FB_CFB_COPYAREA"
check_config_disable
config="CONFIG_FB_CFB_IMAGEBLIT"
check_config_disable
config="CONFIG_FB_SYS_FILLRECT"
check_config_builtin
config="CONFIG_FB_SYS_COPYAREA"
check_config_builtin
config="CONFIG_FB_SYS_IMAGEBLIT"
check_config_builtin
config="CONFIG_FB_SYS_FOPS"
check_config_builtin
#
# Frame buffer hardware drivers
#
config="CONFIG_OMAP2_DSS"
check_config_builtin
config="CONFIG_OMAP2_DSS_SDI"
check_config_disable
#
# OMAP Display Device Drivers (new device model)
#
config="CONFIG_DISPLAY_ENCODER_TFP410"
check_config_builtin
config="CONFIG_DISPLAY_ENCODER_TPD12S015"
check_config_builtin
config="CONFIG_DISPLAY_CONNECTOR_DVI"
check_config_builtin
config="CONFIG_DISPLAY_CONNECTOR_HDMI"
check_config_builtin
config="CONFIG_DISPLAY_CONNECTOR_ANALOG_TV"
check_config_builtin
config="CONFIG_DISPLAY_PANEL_DPI"
check_config_builtin
config="CONFIG_LCD_CLASS_DEVICE"
check_config_module
config="CONFIG_LCD_L4F00242T03"
check_config_disable
config="CONFIG_LCD_LMS283GF05"
check_config_disable
config="CONFIG_LCD_LTV350QV"
check_config_disable
config="CONFIG_LCD_ILI922X"
check_config_disable
config="CONFIG_LCD_ILI9320"
check_config_disable
config="CONFIG_LCD_TDO24M"
check_config_disable
config="CONFIG_LCD_VGG2432A4"
check_config_disable
config="CONFIG_LCD_PLATFORM"
check_config_disable
config="CONFIG_LCD_S6E63M0"
check_config_disable
config="CONFIG_LCD_LD9040"
check_config_disable
config="CONFIG_LCD_AMS369FG06"
check_config_disable
config="CONFIG_LCD_LMS501KF03"
check_config_disable
config="CONFIG_LCD_HX8357"
check_config_disable
config="CONFIG_BACKLIGHT_GENERIC"
check_config_module
#
# Console display driver support
#
config="CONFIG_FRAMEBUFFER_CONSOLE_ROTATION"
check_config_disable
config="CONFIG_LOGO"
check_config_builtin
config="CONFIG_LOGO_LINUX_MONO"
check_config_builtin
config="CONFIG_LOGO_LINUX_VGA16"
check_config_builtin
config="CONFIG_LOGO_LINUX_CLUT224"
check_config_builtin
config="CONFIG_FB_SSD1307"
check_config_builtin
config="CONFIG_SOUND_OSS_CORE_PRECLAIM"
check_config_builtin
config="CONFIG_SND_ALOOP"
check_config_module
config="CONFIG_SND_AC97_POWER_SAVE"
check_config_builtin
config="CONFIG_SND_USB_HIFACE"
check_config_module
config="CONFIG_SND_DAVINCI_SOC"
check_config_module
config="CONFIG_SND_AM33XX_SOC_EVM"
check_config_module
config="CONFIG_SND_SOC_IMX_WM8962"
check_config_module
config="CONFIG_SND_SOC_IMX_SPDIF"
check_config_module
#
# HID support
#
config="CONFIG_HID"
check_config_builtin
config="CONFIG_HID_BATTERY_STRENGTH"
check_config_builtin
config="CONFIG_UHID"
check_config_builtin
config="CONFIG_HID_GENERIC"
check_config_builtin
#
# Special HID drivers
#
config="CONFIG_HID_APPLEIR"
check_config_module
config="CONFIG_HID_PICOLCD_LCD"
check_config_builtin
config="CONFIG_SONY_FF"
check_config_builtin
#
# I2C HID support
#
config="CONFIG_I2C_HID"
check_config_builtin
#
# Miscellaneous USB options
#
config="CONFIG_USB_DEFAULT_PERSIST"
check_config_builtin
config="CONFIG_USB_WUSB_CBAF"
check_config_disable
#
# USB Host Controller Drivers
#
config="CONFIG_USB_XHCI_HCD"
check_config_builtin
config="CONFIG_USB_EHCI_HCD"
check_config_builtin
config="CONFIG_USB_EHCI_MXC"
check_config_disable
config="CONFIG_USB_EHCI_HCD_OMAP"
check_config_builtin
config="CONFIG_USB_OHCI_HCD"
check_config_disable
config="CONFIG_USB_U132_HCD"
check_config_disable
config="CONFIG_USB_MUSB_TUSB6010"
check_config_disable
config="CONFIG_USB_MUSB_OMAP2PLUS"
check_config_builtin
config="CONFIG_USB_MUSB_AM35X"
check_config_disable
config="CONFIG_USB_MUSB_DSPS"
check_config_disable
#
# also be needed; see USB_STORAGE Help for more info
#
config="CONFIG_USB_STORAGE"
check_config_builtin
#
# USB Imaging devices
#
config="CONFIG_USB_CHIPIDEA"
check_config_builtin
config="CONFIG_USB_CHIPIDEA_UDC"
check_config_disable
config="CONFIG_USB_CHIPIDEA_DEBUG"
check_config_disable
#
# USB port drivers
#
config="CONFIG_USB_SERIAL_SIMPLE"
check_config_module
config="CONFIG_USB_SERIAL_SAFE_PADDED"
check_config_builtin
#
# USB Miscellaneous drivers
#
config="CONFIG_USB_HSIC_USB3503"
check_config_module
config="CONFIG_USB_ATM"
check_config_module
config="CONFIG_USB_SPEEDTOUCH"
check_config_module
config="CONFIG_USB_CXACRU"
check_config_module
config="CONFIG_USB_UEAGLEATM"
check_config_module
config="CONFIG_USB_XUSBATM"
check_config_module
#
# USB Physical Layer drivers
#
config="CONFIG_OMAP_CONTROL_USB"
check_config_builtin
config="CONFIG_OMAP_USB3"
check_config_builtin
config="CONFIG_TWL6030_USB"
check_config_builtin
config="CONFIG_USB_GPIO_VBUS"
check_config_builtin
config="CONFIG_USB_MXS_PHY"
check_config_builtin
config="CONFIG_USB_GADGET_VBUS_DRAW"
value="500"
check_config_value
#
# USB Peripheral Controller
#
config="CONFIG_USB_LIBCOMPOSITE"
check_config_builtin
config="CONFIG_USB_U_ETHER"
check_config_builtin
config="CONFIG_USB_F_ECM"
check_config_builtin
config="CONFIG_USB_F_EEM"
check_config_builtin
config="CONFIG_USB_F_SUBSET"
check_config_builtin
config="CONFIG_USB_F_RNDIS"
check_config_builtin
config="CONFIG_USB_ETH"
check_config_builtin
config="CONFIG_USB_ETH_EEM"
check_config_builtin
config="CONFIG_USB_GADGETFS"
check_config_disable
config="CONFIG_USB_G_NOKIA"
check_config_disable
config="CONFIG_MMC_UNSAFE_RESUME"
check_config_builtin
#
# MMC/SD/SDIO Host Controller Drivers
#
config="CONFIG_MMC_SDHCI"
check_config_builtin
config="CONFIG_MMC_SDHCI_PLTFM"
check_config_builtin
config="CONFIG_MMC_SDHCI_ESDHC_IMX"
check_config_builtin
config="CONFIG_MMC_OMAP"
check_config_builtin
config="CONFIG_MMC_OMAP_HS"
check_config_builtin
config="CONFIG_MMC_VUB300"
check_config_disable
config="CONFIG_MMC_USHC"
check_config_disable
config="CONFIG_MEMSTICK"
check_config_disable
#
# LED drivers
#
config="CONFIG_LEDS_LM3530"
check_config_module
config="CONFIG_LEDS_LM3642"
check_config_module
config="CONFIG_LEDS_PCA9532_GPIO"
check_config_builtin
config="CONFIG_LEDS_GPIO"
check_config_builtin
config="CONFIG_LEDS_LP5521"
check_config_module
config="CONFIG_LEDS_LP5562"
check_config_module
config="CONFIG_LEDS_LP8501"
check_config_module
config="CONFIG_LEDS_PCA963X"
check_config_module
config="CONFIG_LEDS_PCA9685"
check_config_module
config="CONFIG_LEDS_PWM"
check_config_module
config="CONFIG_LEDS_TCA6507"
check_config_module
config="CONFIG_LEDS_LM355x"
check_config_module
config="CONFIG_LEDS_OT200"
check_config_module
config="CONFIG_LEDS_BLINKM"
check_config_module
#
# LED Triggers
#
config="CONFIG_LEDS_TRIGGER_TIMER"
check_config_builtin
config="CONFIG_LEDS_TRIGGER_ONESHOT"
check_config_builtin
config="CONFIG_LEDS_TRIGGER_HEARTBEAT"
check_config_builtin
config="CONFIG_LEDS_TRIGGER_BACKLIGHT"
check_config_builtin
config="CONFIG_LEDS_TRIGGER_CPU"
check_config_builtin
config="CONFIG_LEDS_TRIGGER_GPIO"
check_config_builtin
config="CONFIG_LEDS_TRIGGER_DEFAULT_ON"
check_config_builtin
#
# iptables trigger is under Netfilter config (LED target)
#
config="CONFIG_LEDS_TRIGGER_TRANSIENT"
check_config_module
config="CONFIG_LEDS_TRIGGER_CAMERA"
check_config_module
config="CONFIG_ACCESSIBILITY"
check_config_disable
config="CONFIG_EDAC"
check_config_builtin
config="CONFIG_EDAC_LEGACY_SYSFS"
check_config_builtin
config="CONFIG_EDAC_DEBUG"
check_config_disable
config="CONFIG_EDAC_MM_EDAC"
check_config_builtin
#
# RTC interfaces
#
config="CONFIG_RTC_INTF_DEV_UIE_EMUL"
check_config_builtin
#
# I2C RTC drivers
#
config="CONFIG_RTC_DRV_DS1307"
check_config_module
config="CONFIG_RTC_DRV_DS1374"
check_config_module
config="CONFIG_RTC_DRV_DS1672"
check_config_module
config="CONFIG_RTC_DRV_DS3232"
check_config_module
config="CONFIG_RTC_DRV_HYM8563"
check_config_module
config="CONFIG_RTC_DRV_MAX6900"
check_config_module
config="CONFIG_RTC_DRV_RS5C372"
check_config_module
config="CONFIG_RTC_DRV_ISL1208"
check_config_module
config="CONFIG_RTC_DRV_ISL12022"
check_config_module
config="CONFIG_RTC_DRV_ISL12057"
check_config_module
config="CONFIG_RTC_DRV_X1205"
check_config_module
config="CONFIG_RTC_DRV_PALMAS"
check_config_module
config="CONFIG_RTC_DRV_PCF2127"
check_config_module
config="CONFIG_RTC_DRV_PCF8523"
check_config_module
config="CONFIG_RTC_DRV_PCF8563"
check_config_module
config="CONFIG_RTC_DRV_PCF8583"
check_config_module
config="CONFIG_RTC_DRV_M41T80"
check_config_module
config="CONFIG_RTC_DRV_M41T80_WDT"
check_config_builtin
config="CONFIG_RTC_DRV_BQ32K"
check_config_module
config="CONFIG_RTC_DRV_TWL4030"
check_config_module
config="CONFIG_RTC_DRV_TPS65910"
check_config_module
config="CONFIG_RTC_DRV_S35390A"
check_config_module
config="CONFIG_RTC_DRV_FM3130"
check_config_module
config="CONFIG_RTC_DRV_RX8581"
check_config_module
config="CONFIG_RTC_DRV_RX8025"
check_config_module
config="CONFIG_RTC_DRV_EM3027"
check_config_module
config="CONFIG_RTC_DRV_RV3029C2"
check_config_module
#
# SPI RTC drivers
#
config="CONFIG_RTC_DRV_M41T93"
check_config_module
config="CONFIG_RTC_DRV_M41T94"
check_config_module
config="CONFIG_RTC_DRV_DS1305"
check_config_module
config="CONFIG_RTC_DRV_DS1390"
check_config_module
config="CONFIG_RTC_DRV_MAX6902"
check_config_module
config="CONFIG_RTC_DRV_R9701"
check_config_module
config="CONFIG_RTC_DRV_RS5C348"
check_config_module
config="CONFIG_RTC_DRV_DS3234"
check_config_module
config="CONFIG_RTC_DRV_PCF2123"
check_config_module
config="CONFIG_RTC_DRV_RX4581"
check_config_module
#
# Platform RTC drivers
#
config="CONFIG_RTC_DRV_DS1286"
check_config_module
config="CONFIG_RTC_DRV_DS1511"
check_config_module
config="CONFIG_RTC_DRV_DS1553"
check_config_module
config="CONFIG_RTC_DRV_DS1742"
check_config_module
config="CONFIG_RTC_DRV_DA9055"
check_config_module
config="CONFIG_RTC_DRV_STK17TA8"
check_config_module
config="CONFIG_RTC_DRV_M48T86"
check_config_module
config="CONFIG_RTC_DRV_M48T35"
check_config_module
config="CONFIG_RTC_DRV_M48T59"
check_config_module
config="CONFIG_RTC_DRV_MSM6242"
check_config_module
config="CONFIG_RTC_DRV_BQ4802"
check_config_module
config="CONFIG_RTC_DRV_RP5C01"
check_config_module
config="CONFIG_RTC_DRV_V3020"
check_config_module
config="CONFIG_RTC_DRV_DS2404"
check_config_module
#
# on-CPU RTC drivers
#
config="CONFIG_RTC_DRV_MC13XXX"
check_config_builtin
config="CONFIG_RTC_DRV_MXC"
check_config_builtin
config="CONFIG_RTC_DRV_SNVS"
check_config_builtin
config="CONFIG_RTC_DRV_MOXART"
check_config_module
#
# HID Sensor RTC drivers
#
config="CONFIG_RTC_DRV_HID_SENSOR_TIME"
check_config_module
#
# DMA Devices
#
config="CONFIG_DW_DMAC_CORE"
check_config_builtin
config="CONFIG_DW_DMAC"
check_config_builtin
config="CONFIG_MX3_IPU"
check_config_disable
config="CONFIG_TI_EDMA"
check_config_builtin
config="CONFIG_IMX_DMA"
check_config_disable
config="CONFIG_MXS_DMA"
check_config_disable
config="CONFIG_TI_CPPI41"
check_config_builtin
#
# DMA Clients
#
config="CONFIG_ASYNC_TX_DMA"
check_config_disable
config="CONFIG_UIO_PDRV_GENIRQ"
check_config_module
config="CONFIG_UIO_DMEM_GENIRQ"
check_config_module
config="CONFIG_VIRT_DRIVERS"
check_config_disable
config="CONFIG_VIRTIO"
check_config_builtin
#
# Virtio drivers
#
config="CONFIG_VIRTIO_MMIO"
check_config_disable
#
# Microsoft Hyper-V guest support
#
config="CONFIG_USBIP_CORE"
check_config_module
config="CONFIG_USBIP_VHCI_HCD"
check_config_module
config="CONFIG_USBIP_HOST"
check_config_module
config="CONFIG_USBIP_DEBUG"
check_config_disable
config="CONFIG_RTLLIB"
check_config_module
config="CONFIG_RTLLIB_CRYPTO_CCMP"
check_config_module
config="CONFIG_RTLLIB_CRYPTO_TKIP"
check_config_module
config="CONFIG_RTLLIB_CRYPTO_WEP"
check_config_module
config="CONFIG_R8712U"
check_config_module
config="CONFIG_R8188EU"
check_config_module
config="CONFIG_88EU_AP_MODE"
check_config_disable
config="CONFIG_88EU_P2P"
check_config_disable
#
# Accelerometers
#
config="CONFIG_ADIS16201"
check_config_module
config="CONFIG_ADIS16203"
check_config_module
config="CONFIG_ADIS16204"
check_config_module
config="CONFIG_ADIS16209"
check_config_module
config="CONFIG_ADIS16220"
check_config_module
config="CONFIG_ADIS16240"
check_config_module
#
# Android
#
config="CONFIG_ANDROID"
check_config_builtin
config="CONFIG_ANDROID_BINDER_IPC"
check_config_builtin
config="CONFIG_ASHMEM"
check_config_builtin
config="CONFIG_ANDROID_LOGGER"
check_config_module
config="CONFIG_ANDROID_TIMED_OUTPUT"
check_config_builtin
config="CONFIG_ANDROID_TIMED_GPIO"
check_config_module
config="CONFIG_ANDROID_LOW_MEMORY_KILLER"
check_config_disable
config="CONFIG_ANDROID_INTF_ALARM_DEV"
check_config_builtin
config="CONFIG_SYNC"
check_config_builtin
config="CONFIG_SW_SYNC"
check_config_disable
config="CONFIG_ION"
check_config_builtin
config="CONFIG_CED1401"
check_config_module
config="CONFIG_DRM_IMX"
check_config_builtin
config="CONFIG_DRM_IMX_FB_HELPER"
check_config_builtin
config="CONFIG_DRM_IMX_PARALLEL_DISPLAY"
check_config_builtin
config="CONFIG_DRM_IMX_TVE"
check_config_builtin
config="CONFIG_DRM_IMX_LDB"
check_config_builtin
config="CONFIG_DRM_IMX_IPUV3_CORE"
check_config_builtin
config="CONFIG_DRM_IMX_IPUV3"
check_config_builtin
config="CONFIG_DRM_IMX_HDMI"
check_config_builtin
#
# Common Clock Framework
#
config="CONFIG_CLK_TWL6040"
check_config_builtin
config="CONFIG_HWSPINLOCK"
check_config_builtin
#
# Hardware Spinlock drivers
#
config="CONFIG_HWSPINLOCK_OMAP"
check_config_builtin
config="CONFIG_OMAP_IOVMM"
check_config_builtin
#
# Remoteproc drivers
#
config="CONFIG_REMOTEPROC"
check_config_builtin
config="CONFIG_OMAP_REMOTEPROC"
check_config_builtin
#
# Rpmsg drivers
#
config="CONFIG_PM_DEVFREQ"
check_config_builtin
#
# DEVFREQ Governors
#
config="CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND"
check_config_builtin
config="CONFIG_DEVFREQ_GOV_PERFORMANCE"
check_config_builtin
config="CONFIG_DEVFREQ_GOV_POWERSAVE"
check_config_builtin
config="CONFIG_DEVFREQ_GOV_USERSPACE"
check_config_builtin
#
# DEVFREQ Drivers
#
config="CONFIG_MEMORY"
check_config_builtin
config="CONFIG_TI_EMIF"
check_config_builtin
config="CONFIG_IIO_BUFFER_CB"
check_config_builtin
#
# Accelerometers
#
config="CONFIG_BMA180"
check_config_module
config="CONFIG_IIO_ST_ACCEL_3AXIS"
check_config_module
config="CONFIG_IIO_ST_ACCEL_I2C_3AXIS"
check_config_module
config="CONFIG_IIO_ST_ACCEL_SPI_3AXIS"
check_config_module
config="CONFIG_KXSD9"
check_config_module
#
# Analog to digital converters
#
config="CONFIG_AD_SIGMA_DELTA"
check_config_module
config="CONFIG_AD7266"
check_config_module
config="CONFIG_AD7298"
check_config_module
config="CONFIG_AD7476"
check_config_module
config="CONFIG_AD7791"
check_config_module
config="CONFIG_AD7793"
check_config_module
config="CONFIG_AD7887"
check_config_module
config="CONFIG_AD7923"
check_config_module
config="CONFIG_EXYNOS_ADC"
check_config_builtin
config="CONFIG_MAX1363"
check_config_module
config="CONFIG_MCP320X"
check_config_module
config="CONFIG_MCP3422"
check_config_module
config="CONFIG_NAU7802"
check_config_module
config="CONFIG_TI_ADC081C"
check_config_module
config="CONFIG_TI_AM335X_ADC"
check_config_module
config="CONFIG_TWL6030_GPADC"
check_config_module
#
# Amplifiers
#
config="CONFIG_AD8366"
check_config_module
#
# Hid Sensor IIO Common
#
config="CONFIG_IIO_ST_SENSORS_I2C"
check_config_module
config="CONFIG_IIO_ST_SENSORS_SPI"
check_config_module
config="CONFIG_IIO_ST_SENSORS_CORE"
check_config_module
#
# Digital to analog converters
#
config="CONFIG_AD5064"
check_config_module
config="CONFIG_AD5360"
check_config_module
config="CONFIG_AD5380"
check_config_module
config="CONFIG_AD5421"
check_config_module
config="CONFIG_AD5446"
check_config_module
config="CONFIG_AD5449"
check_config_module
config="CONFIG_AD5504"
check_config_module
config="CONFIG_AD5624R_SPI"
check_config_module
config="CONFIG_AD5686"
check_config_module
config="CONFIG_AD5755"
check_config_module
config="CONFIG_AD5764"
check_config_module
config="CONFIG_AD5791"
check_config_module
config="CONFIG_AD7303"
check_config_module
config="CONFIG_MAX517"
check_config_module
config="CONFIG_MCP4725"
check_config_module
#
# Clock Generator/Distribution
#
config="CONFIG_AD9523"
check_config_module
#
# Phase-Locked Loop (PLL) frequency synthesizers
#
config="CONFIG_ADF4350"
check_config_module
#
# Digital gyroscope sensors
#
config="CONFIG_ADIS16080"
check_config_module
config="CONFIG_ADIS16130"
check_config_module
config="CONFIG_ADIS16136"
check_config_module
config="CONFIG_ADIS16260"
check_config_module
config="CONFIG_ADXRS450"
check_config_module
config="CONFIG_IIO_ST_GYRO_3AXIS"
check_config_module
config="CONFIG_IIO_ST_GYRO_I2C_3AXIS"
check_config_module
config="CONFIG_IIO_ST_GYRO_SPI_3AXIS"
check_config_module
config="CONFIG_ITG3200"
check_config_module
#
# Humidity sensors
#
config="CONFIG_DHT11"
check_config_module
#
# Inertial measurement units
#
config="CONFIG_ADIS16400"
check_config_module
config="CONFIG_ADIS16480"
check_config_module
config="CONFIG_INV_MPU6050_IIO"
check_config_module
#
# Light sensors
#
config="CONFIG_ADJD_S311"
check_config_module
config="CONFIG_APDS9300"
check_config_module
config="CONFIG_CM32181"
check_config_module
config="CONFIG_CM36651"
check_config_module
config="CONFIG_GP2AP020A00F"
check_config_module
config="CONFIG_TCS3472"
check_config_module
config="CONFIG_TSL4531"
check_config_module
config="CONFIG_VCNL4000"
check_config_module
#
# Magnetometer sensors
#
config="CONFIG_AK8975"
check_config_module
config="CONFIG_MAG3110"
check_config_module
config="CONFIG_IIO_ST_MAGN_3AXIS"
check_config_module
config="CONFIG_IIO_ST_MAGN_I2C_3AXIS"
check_config_module
config="CONFIG_IIO_ST_MAGN_SPI_3AXIS"
check_config_module
#
# Inclinometer sensors
#
config="CONFIG_HID_SENSOR_INCLINOMETER_3D"
check_config_module
#
# Triggers - standalone
#
config="CONFIG_IIO_INTERRUPT_TRIGGER"
check_config_module
config="CONFIG_IIO_SYSFS_TRIGGER"
check_config_module
#
# Pressure sensors
#
config="CONFIG_MPL3115"
check_config_module
config="CONFIG_IIO_ST_PRESS"
check_config_module
config="CONFIG_IIO_ST_PRESS_I2C"
check_config_module
config="CONFIG_IIO_ST_PRESS_SPI"
check_config_module
#
# Temperature sensors
#
config="CONFIG_TMP006"
check_config_module
config="CONFIG_PWM_IMX"
check_config_builtin
config="CONFIG_PWM_PCA9685"
check_config_builtin
config="CONFIG_PWM_TIECAP"
check_config_builtin
config="CONFIG_PWM_TIEHRPWM"
check_config_builtin
config="CONFIG_PWM_TWL"
check_config_builtin
config="CONFIG_PWM_TWL_LED"
check_config_builtin
config="CONFIG_IPACK_BUS"
check_config_builtin
config="CONFIG_SERIAL_IPOCTAL"
check_config_disable
#
# PHY Subsystem
#
config="CONFIG_OMAP_USB2"
check_config_builtin
config="CONFIG_TWL4030_USB"
check_config_builtin
#
# File systems
#
config="CONFIG_EXT4_FS"
check_config_builtin
config="CONFIG_JBD2"
check_config_builtin
config="CONFIG_FS_MBCACHE"
check_config_builtin
config="CONFIG_XFS_FS"
check_config_builtin
config="CONFIG_BTRFS_FS"
check_config_builtin
config="CONFIG_FANOTIFY_ACCESS_PERMISSIONS"
check_config_builtin
config="CONFIG_AUTOFS4_FS"
check_config_builtin
config="CONFIG_FUSE_FS"
check_config_builtin
#
# DOS/FAT/NT Filesystems
#
config="CONFIG_FAT_FS"
check_config_builtin
config="CONFIG_MSDOS_FS"
check_config_builtin
config="CONFIG_VFAT_FS"
check_config_builtin
config="CONFIG_FAT_DEFAULT_IOCHARSET"
value=\"iso8859-1\"
check_config_value
#
# Pseudo filesystems
#
config="CONFIG_ECRYPT_FS_MESSAGING"
check_config_builtin
config="CONFIG_JFFS2_FS"
check_config_disable
config="CONFIG_ROMFS_BACKED_BY_BLOCK"
check_config_builtin
config="CONFIG_ROMFS_BACKED_BY_BOTH"
check_config_disable
config="CONFIG_F2FS_FS"
check_config_builtin
config="CONFIG_NFS_FS"
check_config_builtin
config="CONFIG_NFS_V2"
check_config_builtin
config="CONFIG_NFS_V3"
check_config_builtin
config="CONFIG_NFS_V4"
check_config_builtin
config="CONFIG_PNFS_FILE_LAYOUT"
check_config_builtin
config="CONFIG_LOCKD"
check_config_builtin
config="CONFIG_NFS_ACL_SUPPORT"
check_config_builtin
config="CONFIG_SUNRPC"
check_config_builtin
config="CONFIG_SUNRPC_GSS"
check_config_builtin
config="CONFIG_SUNRPC_DEBUG"
check_config_disable
config="CONFIG_CIFS_STATS"
check_config_builtin
config="CONFIG_CIFS_STATS2"
check_config_disable
config="CONFIG_CIFS_WEAK_PW_HASH"
check_config_disable
config="CONFIG_CIFS_UPCALL"
check_config_disable
config="CONFIG_CIFS_XATTR"
check_config_disable
config="CONFIG_CIFS_DFS_UPCALL"
check_config_disable
config="CONFIG_NCP_FS"
check_config_disable
config="CONFIG_NLS_DEFAULT"
value=\"iso8859-1\"
check_config_value
config="CONFIG_NLS_CODEPAGE_437"
check_config_builtin
config="CONFIG_NLS_ISO8859_1"
check_config_builtin
#
# printk and dmesg options
#
config="CONFIG_BOOT_PRINTK_DELAY"
check_config_disable
#
# Compile-time checks and compiler options
#
config="CONFIG_STRIP_ASM_SYMS"
check_config_disable
#
# Memory Debugging
#
config="CONFIG_DEBUG_MEMORY_INIT"
check_config_disable
#
# Debug Lockups and Hangs
#
config="CONFIG_LOCKUP_DETECTOR"
check_config_disable
config="CONFIG_SCHEDSTATS"
check_config_builtin
#
# RCU Debugging
#
config="CONFIG_RCU_CPU_STALL_TIMEOUT"
value="60"
check_config_value
config="CONFIG_BLK_DEV_IO_TRACE"
check_config_disable
#
# Runtime Testing
#
config="CONFIG_KGDB"
check_config_builtin
config="CONFIG_KGDB_SERIAL_CONSOLE"
check_config_builtin
config="CONFIG_KGDB_TESTS"
check_config_disable
config="CONFIG_KGDB_KDB"
check_config_builtin
config="CONFIG_KDB_KEYBOARD"
check_config_builtin
config="CONFIG_STRICT_DEVMEM"
check_config_builtin
echo "#Bugs:"
config="CONFIG_CRYPTO_MANAGER_DISABLE_TESTS"
check_config_builtin
config="CONFIG_DRM_VIVANTE"
check_config_disable
config="CONFIG_ATH9K_HW"
check_config_disable
config="CONFIG_ATH9K_COMMON"
check_config_disable
config="CONFIG_ATH9K_BTCOEX_SUPPORT"
check_config_disable
config="CONFIG_ATH9K"
check_config_disable
config="CONFIG_ATH9K_HTC"
check_config_disable
#
|
datatranslation/linux-dev
|
tools/config-checker.sh
|
Shell
|
mit
| 59,420 |
#!
mv apply_application_category.php.closed apply_application_category.php
mv apply_basetechnology_category.php.closed apply_basetechnology_category.php
mv apply_dataset_category.php.closed apply_dataset_category.php
mv apply_idea_category.php.closed apply_idea_category.php
mv apply_visualization_category.php.closed apply_visualization_category.ph
mv modify_application_status.php.closed modify_application_status.php
mv modify_basetechnology_status.php.closed modify_basetechnology_status.php
mv modify_dataset_status.php.closed modify_dataset_status.php
mv modify_idea_status.php.closed modify_idea_status.php
mv modify_visualization_status.php.closed modify_visualization_status.php
mv registered_application.php.closed registered_application.php
mv registered_basetechnology.php.closed registered_basetechnology.php
mv registered_dataset.php.closed registered_dataset.php
mv registered_idea.php.closed registered_idea.php
mv registered_visualization.php.closed registered_visualization.php
|
LinkedOpenData/challenge2015
|
docs/previous/challenge2014/open.application.sh
|
Shell
|
mit
| 997 |
#!/bin/bash
#
echo "This is a test script"
env
exit
|
jkbuster/CI_Test
|
test_script.sh
|
Shell
|
mit
| 53 |
#!/bin/sh
vows --spec
|
CyberCRI/KnowNodes
|
bundledModules/nodemw/run-tests.sh
|
Shell
|
cc0-1.0
| 22 |
#!/bin/sh
export PYTHONPATH=../
python -m doctest ./tests.doctest
python -m doctest ../Readme.md
|
sureshsundriyal/rcu-cache
|
tests/runtests.sh
|
Shell
|
cc0-1.0
| 99 |
script/run-test-start-in-docker.sh onyx-jepsen.onyx-basic-test
|
onyx-platform/onyx-jepsen
|
script/basic-test.sh
|
Shell
|
epl-1.0
| 63 |
#!/bin/bash
##
# Copyright (C) 2008 by Simon Schönfeld
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
SELF="`basename $0`"
# Prints the usage
function print_usage()
{
echo "'$SELF', a tool for faking the kernel network-driver-statistics" >> /dev/stderr
echo "" >> /dev/stderr
echo "Usage: $SELF [--help|--version] IFACE rx|tx FIELD AMOUNT" >> /dev/stderr
echo "" >> /dev/stderr
echo "Options:" >> /dev/stderr
echo " -h, --help, help Show this help" >> /dev/stderr
echo " -v, --version, version Prints version info" >> /dev/stderr
echo " IFACE The name of the interface to change the statistics," >> /dev/stderr
echo " i.e. eth0" >> /dev/stderr
echo " rx, tx Sets whether the statistics in context of received" >> /dev/stderr
echo " (rx) or sent (tx) data should be changed" >> /dev/stderr
echo " FIELD Which field should be changed. Possible values are:" >> /dev/stderr
echo " - bytes" >> /dev/stderr
echo " - packets" >> /dev/stderr
echo " - errs" >> /dev/stderr
echo " - drop" >> /dev/stderr
echo " - fifo" >> /dev/stderr
echo " - frame (only with 'rx' set)" >> /dev/stderr
echo " - compressed" >> /dev/stderr
echo " - multicast (only with 'rx' set)" >> /dev/stderr
echo " - colls (only with 'tx' set)" >> /dev/stderr
echo " - carrier (only with 'tx' set)" >> /dev/stderr
echo " AMOUNT A number the FIELD should be set to or a number to be" >> /dev/stderr
echo " added or substracted from the current value with a" >> /dev/stderr
echo " trailing '=', '+' or '-' to specify if the value" >> /dev/stderr
echo " should be set, added or substracted" >> /dev/stderr
echo "" >> /dev/stderr
echo "This script only provides a more comforable interface to the ifstatfake-kernel-" >> /dev/stderr
echo "module." >> /dev/stderr
echo "If the module is not loaded, this script will try to load it." >> /dev/stderr
echo "First it'll look in the current directory for it and insmod it, if found." >> /dev/stderr
echo "If not, it'll try a modprobe for it." >> /dev/stderr
echo "If the module is loaded by this script, it'll be unloaded automatically." >> /dev/stderr
echo "" >> /dev/stderr
echo "Report bugs to Simon Schönfeld <[email protected]>" >> /dev/stderr
}
function print_version()
{
echo "$SELF 0.1" >> /dev/stderr
echo "Copyright © 2008 Simon Schönfeld" >> /dev/stderr
echo "This is free software. You may redistribute copies of it under the terms of" >> /dev/stderr
echo "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>." >> /dev/stderr
echo "There is NO WARRANTY, to the extent permitted by law." >> /dev/stderr
echo "" >> /dev/stderr
echo "Written by Simon Schönfeld" >> /dev/stderr
}
# Returns whether a command exists or not and prints an error if not
function cmd_available()
{
if ( type $1 &> /dev/null ); then
return 0;
else
echo "$SELF: Required program '$1' not found in path" >> /dev/stderr
return 1;
fi
}
# "--help" requested?
if [[ $1 == "-h" || $1 == "--help" || $1 == "help" ]]; then
print_usage
exit 0;
fi
# "--version" requested?
if [[ $1 == "-v" || $1 == "--version" || $1 == "version" ]]; then
print_version
exit 0;
fi
# Are we root?
if [[ `whoami` != "root" ]]; then
echo "$SELF: You've to be root to run this script" >> /dev/stderr
exit 1;
fi
# We need exactly 4 arguments
if [[ $# != 4 ]]; then
print_usage
exit 2;
fi
# Check for required commands
if ( ! cmd_available ifconfig ) || ( ! cmd_available lsmod ) || ( ! cmd_available insmod ) \
|| ( ! cmd_available rmmod ) || ( ! cmd_available modprobe ); then
exit 3;
fi
# Parse and validate arguments
IFACE=$1
if ( ! ifconfig "$IFACE" &> /dev/null ); then
echo "$SELF: Invalid interface '$IFACE'" >> /dev/stderr
exit 4;
fi
RX_TX=$2
if [[ $RX_TX != "rx" && $RX_TX != "tx" ]]; then
echo "$SELF: Either 'rx' or 'tx' must be set" >> /dev/stderr
exit 5;
fi
FIELD=$3
if [[ $FIELD != "packets" && $FIELD != "errs" && $FIELD != "drop" && $FIELD != "fifo" \
&& $FIELD != "frame" && $FIELD != "compressed" && $FIELD != "multicast" \
&& $FIELD != "colls" && $FIELD != "carrier" ]]; then
echo "$SELF: Invalid FIELD '$FIELD'" >> /dev/stderr
exit 6;
fi
if [[ $RX_TX == "tx" ]] && [[ $FIELD == "frame" || $FIELD == "multicast" ]]; then
echo "$SELF: '$FIELD' isn't allowed with 'tx' set" >> /dev/stderr
exit 7;
fi
if [[ $RX_TX == "rx" ]] && [[ $FIELD == "colls" || $FIELD == "carrier" ]]; then
echo "$SELF: '$FIELD' isn't allowed with 'tx' set" >> /dev/stderr
exit 7;
fi
OP=${4:0:1}
if [[ $OP != "=" && $OP != "+" && $OP != "-" ]]; then
echo "$SELF: '=', '+' or '-' must be set" >> /dev/stderr
exit 8;
fi
AMOUNT=${4:1}
if [[ "x$AMOUNT" == "x" ]]; then
echo "$SELF: A number to set/add/substract must be set" >> /dev/stderr;
exit 9;
fi
if ( ! expr $AMOUNT + 1 &> /dev/null ); then
echo "$SELF: AMOUNT has to be a numberic value" >> /dev/stderr
exit 10;
fi
# Is the module loaded?
MOD_LOADED=0
if ( ! lsmod | grep ifstatfake &> /dev/null ); then
echo "ifstatfake module not in kernel - inserting it" >> /dev/stderr
if [[ -f ifstatfake.ko ]]; then
insmod ifstatfake.ko;
else
if ( ! modprobe ifstatfake ); then
exit 11;
fi
fi
MOD_LOADED=1;
fi
echo $IFACE $RX_TX $FIELD $OP$AMOUNT >> /proc/net/ifstatfake
if [[ $MOD_LOADED == 1 ]]; then
rmmod ifstatfake.ko;
fi
exit 0
|
lynxed/ifstatfake
|
ifstatfake.sh
|
Shell
|
gpl-2.0
| 6,405 |
#!/bin/bash
#
#
#*********************************************************************
# renomme_client_linux_v2.sh
# Ce script permet de renommer un client linux
# Correction de l'uuid de la partition swap après clonage en fin de script
#*********************************************************************
# Section a completer
DATESCRIPT="20171223"
VERSION="1.7"
#Couleurs
ROUGE="\\033[1;31m"
VERT="\\033[1;32m"
BLEU="\\033[1;34m"
JAUNE="\\033[1;33m"
COLTITRE="\033[1;35m" # Rose
COLDEFAUT="\033[0;33m" # Brun-jaune
COLCMD="\033[1;37m" # Blanc
COLERREUR="\033[1;31m" # Rouge
COLTXT="\033[0;37m" # Gris
COLINFO="\033[0;36m" # Cyan
COLPARTIE="\033[1;34m" # Bleu
# On rend le script "cretin-resistant"
[ -e /home/netlogon/clients-linux ] && echo "Malheureux... Ce script est a exécuter sur les clients Linux, pas sur le serveur !" && exit 1
echo -e "$COLINFO"
echo "Renommage du client..."
echo -e "$COLTXT"
echo -e "$COLDEFAUT"
echo "Nom actuel de la machine : $(hostname)"
echo -e "$COLTXT"
# Choix du nouveau nom de la machine
echo "Choix du nouveau nom de cette machine :"
echo ""
echo "Quel nom choisissez-vous pour cette machine ?"
read NOMMACH
echo "Le nom choisi pour la machine est $NOMMACH"
# Choix du RNE de l'etablissement
# echo "Choix du RNE de l'etablissement : "
# echo ""
# echo "Quel est le RNE de l'etablissement ? "
# read RNE
# echo "Le RNE est $RNE"
# Modification du nom de la machine dans smb.conf
sed -i 's/^netbios name.*/netbios\ name\ =\ '$NOMMACH'/g' /etc/samba/smb.conf
# Recuperation de la date et de l'heure pour la sauvegarde des fichiers
DATE=$(date +%F+%0kh%0M)
# Configuration du fichier /etc/hosts
echo -e "$COLINFO"
echo "Configuration du fichier /etc/hosts"
echo -e "$COLTXT"
ANCIENNOM=$(hostname)
#RNE=##se3rne##
cp /etc/hosts /etc/hosts_sauve_$DATE
sed -i 's/^127.0.1.1.*/127.0.1.1\ '"$NOMMACH"'.ac-clermont.fr\ '"$NOMMACH"'/g' /etc/hosts
cp /etc/hostname /etc/hostname_sauve_$DATE
echo "$NOMMACH" > /etc/hostname
# Datage du script (temoin de passage dans /root)
cd /root
rm -f renommage_*
echo "Script de renommage version $VERSION du $DATESCRIPT passe le $DATE" >> /root/renommage_$VERSION_$DATESCRIPT
# Si la machine a été clonée, il faut corriger l'uuid de la partition swap
echo -e "$COLINFO"
echo "Correction de l'uuid de la partition swap après clonage..."
echo -e "$COLTXT"
# On recupère l'uuid correct
blkid | grep 'swap' | cut -d= -f2 | awk '{ print $1}' > /etc/swapuuid
sed -i 's/"//g' /etc/swapuuid
swuid=$(cat /etc/swapuuid)
echo "identifiant correct : $swuid"
# On recupere l'uuid contenu dans /etc/fstab
cat /etc/fstab | grep 'swap' | cut -d= -f2 | awk '{ print $1}' > /etc/wronguuid
sed -i 's/#//g' /etc/wronguuid
sed -i '/^$/d' /etc/wronguuid
wrong=$(cat /etc/wronguuid)
echo "Identifiant à corriger : $wrong"
echo "Contenu de resume : $(cat /etc/initramfs-tools/conf.d/resume)"
# On remplace par la bonne valeur
sed -i 's/'"$wrong"'/'"$swuid"'/g' /etc/fstab
echo "RESUME=UUID=$swuid" > /etc/initramfs-tools/conf.d/resume
echo -e "$COLINFO"
echo "On lance update-initramfs..."
echo -e "$COLTXT"
update-initramfs -u
echo -e "$COLDEFAUT"
echo "Correction uuid swap terminée !"
echo -e "$COLTXT"
# Fin de la configuration
echo -e "$VERT"
echo "Fin de l'opération."
echo "Il faut redemarrer la machine pour prendre en compte le nouveau nom !"
echo -e "$COLTXT"
|
jcmousse/clinux
|
clinuxwin/alancer/renomme_client_linux_v2.sh
|
Shell
|
gpl-2.0
| 3,444 |
#! /bin/sh
# Copyright (C) 2011-2017 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Check that inclusion of '.am' fragments by automake does not suffer
# of the "deleted header problem". This test does the check when the
# SUBDIRS variable is involved.
. test-init.sh
cat >> configure.ac <<'END'
AC_CONFIG_FILES([sub1/Makefile sub2/Makefile])
AC_OUTPUT
END
$ACLOCAL
$AUTOCONF
cat > Makefile.am <<'END'
include foo.am
SUBDIRS = sub1 sub2
END
echo '# this is foo.am' > foo.am
mkdir sub1 sub2
echo 'include $(srcdir)/bar.am' > sub1/Makefile.am
echo '# this is bar.am' > sub1/bar.am
echo 'include $(top_srcdir)/foo.am' > sub2/Makefile.am
$AUTOMAKE
# Sanity checks.
$FGREP 'this is foo.am' Makefile.in
$FGREP 'this is bar.am' sub1/Makefile.in
$FGREP 'this is foo.am' sub2/Makefile.in
./configure
$MAKE # Should be no-op.
$sleep
echo '# this is sub1/Makefile.am' > sub1/Makefile.am
rm -f sub1/bar.am
$MAKE all
# Sanity checks.
$FGREP 'this is bar' sub1/Makefile.in sub1/Makefile && exit 1
$FGREP 'this is sub1/Makefile.am' sub1/Makefile.in
$FGREP 'this is sub1/Makefile.am' sub1/Makefile
$sleep
for d in . sub2; do
sed "s|.*include.*foo\.am.*|# this is $d/Makefile.am|" $d/Makefile.am > t
mv -f t $d/Makefile.am
done
rm -f foo.am
$MAKE all
# Sanity checks.
$FGREP 'this is foo' sub*/Makefile* Makefile* && exit 1
for d in . sub1 sub2; do
$FGREP "this is $d/Makefile.am" $d/Makefile.in
$FGREP "this is $d/Makefile.am" $d/Makefile
done
:
|
pylam/automake
|
t/remake-deleted-am-subdir.sh
|
Shell
|
gpl-2.0
| 2,061 |
#!/bin/bash
export ARCH=arm
export CROSS_COMPILE=/opt/toolchains/arm-eabi-4.4.3/bin/arm-eabi-
make countdev_defconfig
make -j16
echo Galaxy Grand Kernel OpenSoure by Count
|
tyler6389/android_kernel_samsung_baffinlte
|
build.sh
|
Shell
|
gpl-2.0
| 174 |
#! /bin/bash
if [[ $UID -ne 0 ]]; then sudo "$0"; exit 0; fi
echo 'Now going to server setup, here we go...'
echo '------------------------------------'
read -p "THIS SCRIPT WAS MADE AND TESTED FOR *FEDORA 20*!!
Are you sure you want to continue? [yn]" answer
if [[ $answer = y ]] ; then
echo "Okay..." ;
fi
read -p "This script will be able to install modularly the following things
Update and install RHEL repo and htop
LAMP stack
hosts and hostname files
Create VNC server
Configure email SSMTP
Configure Raid Array (Linux RAID 10 for 4 drives)
Configure a RAID Array with btfrs? (4 drives required, RAID 6)? [yn]
Samba confirguration for the RAID
Install and configure webmin
Configure firewall
Implement a dynamic MOTD
So are you ready to continue? [yn]" answer
if [[ $answer = y ]] ; then
echo "Okay, let's go..." ;
fi
read -p "Run the update script and install htop? [yn]" answer
if [[ $answer = y ]] ; then
yum -y update
echo 'Installing htop...'
yum -y install htop ;
fi
read -p "Setup LAMP stack? [yn]" answer
if [[ $answer = y ]] ; then
yum -y update
yum -y install httpd
systemctl start httpd.service
yum -y install mariadb-server mariadb
ssystemctl start mariadb
mysql_secure_installation
yum -y install php php-mysql
yum -y install php-*
systemctl enable httpd.service
systemctl enable mariadb.service ;
fi
read -p "Change host file contents? [yn]" answer
if [[ $answer = y ]] ; then
read -p "Please enter the desired Static IP Address for the server on LAN: " ipaddressinput
read -p "Please neter your desired domain name for the server: " domainnameinput
read -p "Please neter your desired name for the server: " servernameinput
echo "127.0.0.1 localhost" > /etc/hosts
echo "127.0.1.1 $servernameinput.$domainnameinput.local $servernameinput" >> /etc/hosts
echo "$ipaddressinput $servernameinput.$domainnameinput.local $servernameinput" >> /etc/hosts
echo "$servernameinput.$domainnameinput.local" > /etc/hostname
echo "Server name has been set to:"
hostname -s
echo "Server full hostname has been set to:"
hostname -f
service network restart
echo "Server is currently set for this network config:"
ifconfig
fi
read -p "Add VNC server? [yn]" answer
if [[ $answer = y ]] ; then
yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"
yum -y install gnome-core xfce4 firefox
yum -y install tigervnc-server
service vncserver start
service vncserver stop
chkconfig vncserver on
wget http://pkgs.repoforge.org/x11vnc/x11vnc-0.9.13-1.el7.rf.x86_64.rpm
ls *.rpm
yum -y install x11vnc-0.9.13-1.el7.rf.x86_64.rpm
mkdir /root/.vnc/
x11vnc -storepasswd /root/.vnc/passwd
vncpassword
startx
service vncserver start
systemcl enable vncserver.service
fi
read -p "Configure a RAID Array with 4 drives? (4 drives required, Linux RAID 10)? [yn]" answer
if [[ $answer = y ]] ; then
fdisk -l
read -p "Drive 1: " drive1
read -p "Drive 2: " drive2
read -p "Drive 3: " drive3
read -p "Drive 4: " drive4
mdadm --create /dev/md0 --chunk=256 --level=10 -p f2 --raid-devices=4 /dev/$drive1 /dev/$drive2 /dev/$drive3 /dev/$drive4 --verbose
echo "Configuring mdadm"
mdadm --detail --scan --verbose > /etc/mdadm.conf
echo "Setting RAID Array to ext4 file system"
mkfs.ext4 /dev/md0
echo "Creating mount point..."
mkdir /media/raid10
echo "Editing fstab"
echo "/dev/md0 /media/raid10/ ext4 defaults 1 2" >> /etc/fstab
echo "Simulating boot..."
mount -a
mount
echo "Please check to see if RAID mounted in the simulation"
echo "Sending a test RAID Array alert email"
mdadm --monitor --scan --test --oneshot
echo "Adding mdadm config for on boot"
echo 'DAEMON_OPTIONS="--syslog --test"' >> /etc/default/mdadm
fi
read -p "Configure a RAID Array with btfrs? (4 drives required, RAID 6)? [yn]" answer
if [[ $answer = y ]] ; then
fdisk -l
read -p "Drive 1: " drive1
read -p "Drive 2: " drive2
read -p "Drive 3: " drive3
read -p "Drive 4: " drive4
mkfs.btrfs -L /dev/$drive1 /dev/$drive2 /dev/$drive3 /dev/$drive4
echo "Striping the data, no mirroring, RAID0"
mkfs.btrfs -d raid0 /dev/$drive1 /dev/$drive2
echo "RAID10 for both data and metadata"
mkfs.btrfs -m raid10 -d raid10 /dev/$drive1 /dev/$drive2 /dev/$drive3 /dev/$drive4
echo "Don't duplicate metadata on a single drive"
mkfs.btrfs -m single /dev/$drive1
echo "Simulating boot..."
mount -a
mount
echo "Please check to see if RAID mounted in the simulation"
fi
read -p "Configure SAMBA for the RAID Array? [yn]" answer
if [[ $answer = y ]] ; then
fdisk -l
read -p "Set Main Network Drive Share Name: " sambadir
echo "" >> /etc/samba/smb.conf
echo "/media/raid10/$sambadir" >> /etc/samba/smb.conf
echo "valid users = @users" >> /etc/samba/smb.conf
echo "force group = users" >> /etc/samba/smb.conf
echo "create mask = 0660" >> /etc/samba/smb.conf
echo "directory mask = 0771" >> /etc/samba/smb.conf
echo "writable = yes" >> /etc/samba/smb.conf
echo "read only = No" >> /etc/samba/smb.conf
echo "Added share, restarting samba"
systemctl restart smb.service
systemctl restart nmb.service
echo "Adding firewall rule for samba"
firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload
echo "Adding administrator to samba users"
usermod -aG users administrator
echo "Set password for administrator for samba"
smbpasswd -a administrator
fi
read -p "Install and configure Webmin? [yn]" answer
if [[ $answer = y ]] ; then
cd /opt
wget http://www.webmin.com/jcameron-key.asc
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.700-1.noarch.rpm
rpm --import jcameron-key.asc
rpm -Uvh webmin-1.700-1.noarch.rpm
echo "Webmin installed, please synchronise Samba users and system user in servers, samba windows file sharing, user sync, and select yes to everything and apply"
echo "Create new users in Samba, Users and groups and put them in users group"
fi
read -p "Configure iptables firewall? [yn]" answer
if [[ $answer = y ]] ; then
read -p "Turn off firewall? [yn]" answer
if [[ $answer = y ]] ; then
systemctl stop firewalld.service
fi
echo "iptables configured"
echo "Use the command iptables -A INPUT -p tcp --dport PORT -j ACCEPT to add more later"
fi
read -p "Install a Dynamic MOTD? [yn]" answer
if [[ $answer = y ]] ; then
mkdir setupfiles
cd serverfiles
wget http://giz.moe/server-scripts/dynmotd/fedora-20/dynmotd
wget http://giz.moe/server-scripts/dynmotd/login
wget http://giz.moe/server-scripts/dynmotd/profile
wget http://giz.moe/server-scripts/dynmotd/sshd_config
wget http://giz.moe/server-scripts/dynmotd/screenfetch
cp dynmotd /usr/local/bin/
cp login /etc/pam.d/
cp profile /etc/
cp sshd_config /etc/ssh/
cp sshd_config /etc/ssh/
mv screenfetch /usr/bin/
chown root /etc/pam.d/login
chown root /etc/profile
chown root /etc/ssh/
chmod 755 /usr/local/bin/dynmotd
chmod 644 /etc/pam.d/login
chmod 644 /etc/profile
chmod 600 /etc/ssh/sshd_config
chmod 755 /usr/bin/screenfetch
systemctl stop sshd
echo "Edit /usr/local/bin/dynmotd to change the MOTD."
echo "Log out and log back in to test the new MOTD"
fi
|
Drybones5/Server-Setup-Scripts
|
Fedora 20/fedora20setup.sh
|
Shell
|
gpl-2.0
| 7,072 |
wcl386 makeobj.c
./makeobj c AUDIODCT.KDR ../KDRADICT.OBJ _audiodict
./makeobj f AUDIOHHD.KDR ../KDRAHEAD.OBJ _AudioHeader _audiohead
./makeobj c CGADICT.KDR ../KDRCDICT.OBJ _CGAdict
./makeobj f CGAHEAD.KDR ../KDRCHEAD.OBJ CGA_grafixheader _CGAhead
./makeobj f CONTEXT.KDR ../CONTEXT.OBJ
./makeobj c EGADICT.KDR ../KDREDICT.OBJ _EGAdict
./makeobj f EGAHEAD.KDR ../KDREHEAD.OBJ EGA_grafixheader _EGAhead
./makeobj f GAMETEXT.KDR ../GAMETEXT.OBJ
./makeobj c MAPDICT.KDR ../KDRMDICT.OBJ _mapdict
./makeobj f MAPHEAD.KDR ../KDRMHEAD.OBJ MapHeader _maphead
./makeobj s PIRACY.SCN ../PIRACY.h 7
./makeobj f STORY.KDR ../STORY.OBJ
|
sparky4/owkeen
|
static/make.sh
|
Shell
|
gpl-2.0
| 624 |
#!/bin/bash
DUMP=$1
DIRJACKRABBIT=/usr/local/jackrabbit/develop
if [ -f $DUMP ];
then
echo "start import Jackrabbit database"
sudo rm -rf $DIRJACKRABBIT/jackrabbit/*
sudo tar -zxf $DUMP -C $DIRJACKRABBIT
sudo chmod -R 777 $DIRJACKRABBIT/jackrabbit
echo "Jackrabbit database imported"
else
echo "error -> No Jackrabbit database to import"
exit 3
fi
|
gvandencruche/project_symfony
|
provisioners/shell/plateform/importJR.sh
|
Shell
|
gpl-2.0
| 406 |
#!/usr/bin/env sh
if command -v rst2html.py >/dev/null 2>&1
then rst2html.py \
'--input-encoding=UTF-8:strict' \
'--embed-stylesheet' \
'--stylesheet-path=stylesheet.css' \
-- "${1}" "${2}"
exit
fi
if test -r "${2}"
then echo "warning: using existing ${2} since rst2html.py is not available" >&2
touch "${2}" || : >>"${2}"
exit
else echo "error: ${2} does not exist and rst2html.py is not available" >&2
exit 1
fi
|
BackupTheBerlios/eix
|
doc/call_rst2html.sh
|
Shell
|
gpl-2.0
| 426 |
#!/bin/sh
../../spidir \
-p ../data/flies.nt.param \
-S ../data/flies.smap \
-s ../data/flies.stree \
-a ../data/0.nt.align \
-o ../output/fly \
--search climb \
-D 0.2 \
-L 0.19 \
-V 2 \
-i 100 \
--correct ../data/0.nt.tree $*
|
mdrasmus/spimap
|
test/scripts/old/fly_test.sh
|
Shell
|
gpl-2.0
| 274 |
#! /bin/sh
# Copyright (C) 2012-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Recursive use of 'check-html'. See Automake bug#11287.
. test-init.sh
# Try the variants that are tried in check-html.am.
while :; do
for r2h in $RST2HTML rst2html rst2html.py; do
echo "$me: running $r2h --version"
$r2h --version && break 2
: For shells with busted 'set -e'.
done
skip_all_ "no proper rst2html program found"
done
unset r2h
cp "$am_top_srcdir"/contrib/check-html.am . \
|| fatal_ "cannot fetch 'check-html.am' from contrib"
cat >> configure.ac << 'END'
AM_EXTRA_RECURSIVE_TARGETS([check-html])
AC_CONFIG_FILES([sub/Makefile sub/more/Makefile])
AC_OUTPUT
END
cat > Makefile.am << 'END'
SUBDIRS = sub
EXTRA_DIST = $(TESTS)
TEST_SUITE_LOG = mylog.log
TESTS = foo.test bar.sh mu
XFAIL_TESTS = bar.sh
check_SCRIPTS = bla
bla:
echo '#!/bin/sh' > $@-t
echo 'echo Blah Blah Blah' >> $@-t
chmod a+x,a-w $@-t
mv -f $@-t $@
CLEANFILES = bla
include $(srcdir)/check-html.am
END
mkdir sub
echo SUBDIRS = more > sub/Makefile.am
mkdir sub/more
cat > sub/more/Makefile.am << 'END'
include $(top_srcdir)/check-html.am
TEST_EXTENSIONS = .test .sh
TESTS = sh.sh test.test
LOG_COMPILER = true
test.log: sh.log
nodist_check_DATA = x.txt
$(nodist_check_DATA):
echo $@ > $@
CLEANFILES = $(nodist_check_DATA)
EXTRA_DIST = $(TESTS)
END
cat > foo.test <<'END'
#! /bin/sh
./bla
exit 77
END
cat > bar.sh <<'END'
#! /bin/sh
echo "this is $0"
exit 1
END
cat > mu <<'END'
#! /bin/sh
set -x
test -f sub/more/test.log
test -f sub/more/sh.log
END
cat > sub/more/test.test << 'END'
#!/bin/sh
echo "this is $0"
set -x
test -f sh.log
test -f x.txt
exit 77
END
cat > sub/more/sh.sh << 'END'
#!/bin/sh
set -x
test ! -f test.log
test -f x.txt
END
cat > sub/more/mu << 'END'
#!/bin/sh
exit 99
END
chmod a+x foo.test bar.sh mu sub/more/test.test sub/more/sh.sh
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
./configure
$MAKE check-html
grep 'Blah Blah Blah' mylog.html
grep 'this is .*bar\.sh' mylog.html
grep 'this is .*test\.test' sub/more/test-suite.html
# check-html should cause check_SCRIPTS and check_DATA to be created.
test -f bla
test -f sub/more/x.txt
# "make clean" should remove HTML files.
$MAKE clean
test ! -e mylog.html
test ! -e sub/more/test-suite.html
test ! -e bla
test ! -e sub/more/x.txt
# Create HTML output for individual tests.
$MAKE bla
$MAKE foo.html bar.sh.html
grep 'Blah Blah Blah' foo.html
grep 'this is .*bar\.sh' bar.sh.html
test ! -e mu.hml
ocwd=$(pwd) || fatal_ "getting current workind directory"
( cd sub/more \
&& $MAKE sh.html \
&& test -f sh.html \
&& test ! -e test.html \
&& $MAKE test.html \
&& grep 'this is .*test\.test' test.html) || exit 1
# HTML output removed by mostlyclean.
$MAKE check-html
test -f mylog.html
test -f sub/more/test-suite.html
$MAKE mostlyclean
find . -name '*.html' | grep . && exit 1
$MAKE distcheck
:
|
komh/automake-os2
|
contrib/t/parallel-tests-html-recursive.sh
|
Shell
|
gpl-2.0
| 3,497 |
#!/bin/bash
# Useage: qsub parallel_mpich2_smpd.sh
# Output: <JOB_NAME>.o<JOB_ID>
# Lines begin with "#$" are to set qsub parameters.
# Lines begin with "#" except "#!" and "#$" are comments.
#$ -S /bin/bash
#$ -cwd
#$ -m beas
#$ -j y
###$ -v PATH,LD_LIBRARY_PATH,MPIEXEC_RSH=/usr/bin/rsh,MPI_HOME
#$ -v PATH,LD_LIBRARY_PATH,MPI_HOME
######### set job's name
#$ -N FDTD_MPI
######### set Parallel Environment and processes/cores number
#$ -pe mpich2_smpd_roundrobin 40
# parallel environment types for mpich2:
# mpich2_smpd: execute job by smpd, use as few nodes as possible
######### IMPORTANT
######### 1. set compile environment in $HOME/.bash_profile before compile programs:
######### module unload openmpi/1.4.1-intel-11.1.046
######### module load intel/compiler-11.1.046 mpich2/smpd-1.2.1p1-intel-11.1.046
######### 2. set mpich2 smpd parameters:
######### echo phrase=123456 > $HOME/.smpd
######### chmod 600 $HOME/.smpd
date
echo "Got $NSLOTS slots."
echo "PATH = $PATH"
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
WORKPATH=`pwd`
echo "Current Directory = $WORKPATH"
export SMPD_OPTION_NO_DYNAMIC_HOSTS=1
PORT=$((JOB_ID % 5000 + 20000))
echo "Begin computing ......"
######### execute PROGRAM_NAME
$MPI_HOME/bin/mpiexec -machinefile $TMPDIR/machines -np $NSLOTS -port $PORT -wdir $WORKPATH $WORKPATH/FDTD_MPI
date
exit 0
|
IFDYS/IO_MPI
|
parallel_mpich2_smpd.sh
|
Shell
|
gpl-2.0
| 1,352 |
#!/bin/sh
# add printer to cups
printer_name=""
printer_fname=""
printer_loc=""
loop="y"
creatsvcfile=""
while [ $loop == "y" ] || [ $loop == "Y" ]
do
echo "Printer Display Name: (This should be human-readable)"
read printer_name
echo "Printer filename: (This cannot have spaces)"
read printer_fname
echo "Printer Location:"
read printer_loc
echo " adding lpadmin -p $printer_fname -L "$printer_loc" -E -v dnssd://$printer_name._ipp._tcp.local. -P /System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Resources/Generic.ppd"
lpadmin -p $printer_fname -L "$printer_loc" -E -v dnssd://$printer_fname._ipp._tcp.local. -P /System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Resources/Generic.ppd
if [ -e /opt/local/etc/avahi/services/$printer_fname.service ]
then
echo "Service file found for printer."
else
echo "No Service file found; printer is not currently set up for AirPlay. Create Service file now? Enter [Y/y]es or any other character for no."
read creatsvcfile
if [ $creatsvcfile == "y" ] || [ $creatsvcfile == "Y" ]
then
echo "<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE service-group SYSTEM 'avahi-service.dtd'>
<service-group>
<name replace-wildcards='yes'>'Air Print: $printer_name'</name>
<service>
<host-name>riaentmbjr-p01.advisory.com</host-name>
<type>_ipp._tcp</type
<subtype>_universal._sub._ipp._tcp</subtype>
<port>631</port>
<txt-record>txtvers=1</txt-record>
<txt-record>qtotal=1</txt-record>
<txt-record>Transparent=T</txt-record>
<txt-record>URF=W8,SRGB24,RS300,DM1,CP255</txt-record>
<txt-record>rp=printers/$printer_name</txt-record>
<txt-record>note=Dell 2350dn Laser Printer</txt-record>
<txt-record>product=(GPL Ghostscript)</txt-record>
<txt-record>printer-state=3</txt-record>
<txt-record>printer-type=0x8090dc</txt-record>
<txt-record>pdl=application/octet-stream,application/postscript,image/urf,application/vnd.cups-command,application/vnd.cups-postscript,application/vnd.cups-raw</txt-record>
</service>
</service-group>" > "/opt/local/etc/avahi/services/$printer_fname.service"
fi
fi
echo "Add printer? Enter [Y/y]es or any other character for no"
read loop
done
|
alexvirital/osx-scripts
|
add_cups_printer.sh
|
Shell
|
gpl-2.0
| 2,270 |
#! /bin/sh -e
# tup - A file-based build system
#
# Copyright (C) 2010-2022 Mike Shal <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Make sure moving a directory out of tup will successfully remove watches on
# all the subdirectories. Use the USR1 signal to have the monitor quit if it
# has a watch on any invalid tupid.
. ./tup.sh
check_monitor_supported
mkdir tuptest
cd tuptest
re_init
monitor
mkdir -p foo/bar
cd foo/bar
echo 'int main(void) {return 0;}' > foo.c
echo ': foreach *.c |> gcc %f -o %o |> %B' > Tupfile
cd ../..
update
signal_monitor
mv foo ..
tup flush
signal_monitor
stop_monitor
update
tup_object_no_exist . foo
eotup
|
gittup/tup
|
test/t7035-move-dir-out2.sh
|
Shell
|
gpl-2.0
| 1,262 |
VFD=../mtximage # change VFD to YOUR virtual fd
echo "--------------------- make $1 -----------------------"
as86 -o user.o user.s
bcc -c -ansi $1.c ucode.c
ld86 -o $1 user.o $1.o ucode.o ../mtxlib /usr/lib/bcc/libc.a
if [ -f $1 ]; then
echo "*** Copy to disk ************************************"
sudo mount -o loop $VFD /mnt
sudo cp $1 /mnt/bin/$1
sudo umount /mnt
echo "*** Clean-up build **********************************"
rm *.o $1
echo done $1
fi
|
fossum/wsu_cs460
|
lab6/USER/make.sh
|
Shell
|
gpl-2.0
| 489 |
#!/bin/sh
################################################################################
## ##
## Copyright (c) International Business Machines Corp., 2009 ##
## ##
## This program is free software; you can redistribute it and#or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version 2 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, but ##
## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ##
## for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program; if not, write to the Free Software ##
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ##
## ##
################################################################################
LTPTMP=/tmp/p9auth_ltp
TOUCH=`which touch`
ID=`which id`
echo ltptmp is $LTPTMP
myuid=`id -u`
if [ "$myuid" -eq 0 ]; then
echo "Unprivileged child was started as root!"
exit 1
fi
$TOUCH $LTPTMP/d/childready
while [ 1 ]; do
if [ -f $LTPTMP/childexit ]; then
exit 0
fi
if [ -f $LTPTMP/childgo ]; then
echo -n `cat $LTPTMP/d/txtfile` > /dev/capuse
if [ `$ID -u` -eq 0 ]; then
$TOUCH $LTPTMP/d/childpass
else
$TOUCH $LTPTMP/d/childfail
fi
exit 0
fi
done
exit 0
|
anthony-kolesov/arc_ltp
|
testcases/kernel/security/p9auth/p9unpriv.sh
|
Shell
|
gpl-2.0
| 2,036 |
#!/bin/bash
git status | head -n 1 | grep "branch master" > /dev/null;
if [ "$?" != "0" ];then
echo "not allowed for non master branch";
exit 0;
fi
cwd=`pwd`
./utils/importTemplatesOnlyNew.sh spanish;
/usr/sbin/unxsRAD ProcessJobQueue;
cd /var/local/unxsRAD/apps/unxsAK;
export CGIDIR=/var/www/cgi-bin;
export unxsAK=/var/local/unxsRAD/apps/unxsAK;
./utils/importTemplates.sh;
cd interface;
make install;
cd $cwd;
|
unxs0/unxsVZ
|
unxsRAD/InstallInterfaceSpanish.sh
|
Shell
|
gpl-2.0
| 420 |
#!/bin/bash
#Generate a list of all of the pictures for the lock screen.
PICT=$(for i in `ls /home/dwalton/background/`; do echo /home/dwalton/background/$i; done | sort -R | head -1);
#now to lock the screen.
feh --bg-scale $PICT;
|
plainenough/linux_tools
|
bg.sh
|
Shell
|
gpl-2.0
| 238 |
#! /bin/bash
#echo begining
# set as=$#argv
filename="http://m.cricbuzz.com/interview/playerlist"
wget --quiet -O relative $filename
while :
do
echo "Menu"
echo "1. Players name"
echo "2. Country"
echo "3. Role"
echo "4. Players having no.of matches greater than given number in ODIs "
echo "5. Players having no.of runs greater than given number in ODIs "
echo "6. Players having no.of wickets greater than given number in ODIs "
echo "7. Exit "
echo "enter the choice!"
read s
case $s in
1) echo "enter the player name "
read name
arr=($name)
egrep -A 1 ${arr[1]}.*${arr[2]} relative > tem.txt
url=$(grep -o 'http://[^"]*' tem.txt)
echo "$url"
wget --quiet $url -O data.json
echo "-----------------------------------------------------"
echo "-----------------------------------------------------"
echo $name
b='a. Country-'
country=`java -jar json2txt.jar -i data.json "/playerInfo/team"`
echo $b$country
DoB=`java -jar json2txt.jar -i data.json "/playerInfo/DoB"`
BirthYear=$(echo `expr "$DoB" : '\(.*[0-9][0-9][0-9][0-9]\)'`)
CurrentYear=2015
Age=$(($CurrentYear - $BirthYear))
c='b. Age-'
echo $c$Age
player_role=`java -jar json2txt.jar -i data.json "/playerInfo/player_role"`
d='c. Player Role-'
echo $d$player_role
e='d. Bat/Bowl style-'
l='/'
playerBatStyle=`java -jar json2txt.jar -i data.json "/playerInfo/playerBatStyle"`
playerBowlStyle=`java -jar json2txt.jar -i data.json "/playerInfo/playerBowlStyle"`
echo $e$playerBatStyle$l$playerBowlStyle
matches=`java -jar json2txt.jar -i data.json "/odiStats/Matches"`
echo "-------ODI STATS---------"
f='e. Number of matches-'
echo $f$matches
runs=`java -jar json2txt.jar -i data.json "/odiStats/Runs"`
g='f. Runs-'
echo $g$runs
wickets=`java -jar json2txt.jar -i data.json "/odiStats/WicketsTaken"`
h='g. Wickets-'
echo $h$wickets
echo "----------------------------------------------------"
echo "----------------------------------------------------"
;;
2) echo "enter the country name "
read team
filename=relative
tempt=team
mkdir "$tempt"
while read -r line
do
[[ "$line" = "\{*" ]] && continue
read -r line
read -r line
read -r line
photo=$line
echo $photo
read -r line
name=$line
read -r line
x=$line
echo $x > tem.txt
url=$(grep -o 'http://[^"]*' tem.txt)
echo $url
wget --quiet -O player.json $url
country=`java -jar json2txt.jar -i player.json "/playerInfo/team"`
if [ "$country" == "$team" ]; then
full=`java -jar json2txt.jar -i player.json "/playerInfo/completeName"`
name=`java -jar json2txt.jar -i player.json "/playerInfo/nickName"`
echo $name
link=$(echo `expr "$photo" : '.*\(http:.*jpg\)'`)
cd "$team"
curl $link | convert - $name.jpg
cd ..
fi
done < "$filename"
;;
3) echo "enter the country role "
read team
filename=relative
tempt=$team
mkdir "$tempt"
while read -r line
do
[[ "$line" = "\{*" ]] && continue
read -r line
read -r line
read -r line
photo=$line
read -r line
name=$line
read -r line
x=$line
echo $x > tem.txt
url=$(grep -o 'http://[^"]*' tem.txt)
wget --quiet $url -O player.json
country=`java -jar json2txt.jar -i player.json "/playerInfo/player_role"`
if [ "$country" == "$team" ]; then
full=`java -jar json2txt.jar -i player.json "/playerInfo/completeName"`
echo "$full"
name=`java -jar json2txt.jar -i player.json "/playerInfo/nickName"`
link=$(echo `expr "$photo" : '.*\(http:.*jpg\)'`)
cd $tempt
curl $link | convert - $name.jpg
cd ..
fi
done < "$filename"
;;
4) echo "Give the number of ODIs "
read given
z=0
filename=relative
tempt=team
counter=1
echo "S.No. Name Matches"
while read -r line
do
[[ "$line" = "\{*" ]] && continue
read -r line
read -r line
read -r line
photo=$line
read -r line
name=$line
read -r line
x=$line
echo $x > tem.txt
url=$(grep -o 'http://[^"]*' tem.txt)
wget --quiet $url -O player.json
matches=`java -jar json2txt.jar -i player.json "/odiStats/Matches"`
if(("$matches" > "$z")); then
if(("$matches" > "$given")); then
full=`java -jar json2txt.jar -i player.json "/playerInfo/completeName"`
a="."
counter=$(($counter+1))
echo $counter$a " " $full " " $matches
fi
fi
done < "$filename"
;;
5) echo "Give the number of runs "
read given
filename=relative
tempt=team
z=0
counter=1
echo "S.No. Name Run"
while read -r line
do
[[ "$line" = "\{*" ]] && continue
read -r line
read -r line
read -r line
photo=$line
read -r line
name=$line
read -r line
x=$line
echo $x > tem.txt
url=$(grep -o 'http://[^"]*' tem.txt)
wget --quiet $url -O player.json
runs=`java -jar json2txt.jar -i player.json "/odiStats/Runs"`
if(("$runs" > "$z")); then
if(("$runs" > "$given")); then
full=`java -jar json2txt.jar -i player.json "/playerInfo/completeName"`
a="."
counter=$(($counter+1))
echo $counter$a " " $full " " $runs
fi
fi
done < "$filename"
;;
6) echo "Give the number of wickets "
read given
filename=relative
tempt=team
z=0
counter=1
echo "S.No. Name Wickets"
while read -r line
do
[[ "$line" = "\{*" ]] && continue
read -r line
read -r line
read -r line
photo=$line
read -r line
name=$line
read -r line
x=$line
echo $x > tem.txt
url=$(grep -o 'http://[^"]*' tem.txt)
wget --quiet $url -O player.json
wickets=`java -jar json2txt.jar -i player.json "/odiStats/WicketsTaken"`
if(("$wickets" > "$z")); then
if(("$wickets" > "$given"));then
full=`java -jar json2txt.jar -i player.json "/playerInfo/completeName"`
a="."
counter=$(($counter+1))
echo $counter$a " " $full " " $wickets
fi
fi
done < "$filename"
;;
7) exit
;;
esac
done
|
DushyantSahoo/playerinfo-extractor
|
ass2.bash
|
Shell
|
gpl-2.0
| 6,262 |
#!/bin/sh
# Copyright (C) 2011 OpenWrt.org
UCIDEF_LEDS_CHANGED=0
ucidef_set_led_netdev() {
local cfg="led_$1"
local name=$2
local sysfs=$3
local dev=$4
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.name='$name'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='netdev'
set system.$cfg.dev='$dev'
set system.$cfg.mode='link tx rx'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_set_led_usbdev() {
local cfg="led_$1"
local name=$2
local sysfs=$3
local dev=$4
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.name='$name'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='usbdev'
set system.$cfg.dev='$dev'
set system.$cfg.interval='50'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_set_led_wlan() {
local cfg="led_$1"
local name=$2
local sysfs=$3
local trigger=$4
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.name='$name'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='$trigger'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_set_led_switch() {
local cfg="led_$1"
local name=$2
local sysfs=$3
local trigger=$4
local port_mask=$5
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.name='$name'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='$trigger'
set system.$cfg.port_mask='$port_mask'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_set_led_default() {
local cfg="led_$1"
local name=$2
local sysfs=$3
local default=$4
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.name='$name'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.default='$default'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_set_led_rssi() {
local cfg="led_$1"
local name=$2
local sysfs=$3
local iface=$4
local minq=$5
local maxq=$6
local offset=$7
local factor=$8
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='led'
set system.$cfg.name='$name'
set system.$cfg.sysfs='$sysfs'
set system.$cfg.trigger='rssi'
set system.$cfg.iface='rssid_$iface'
set system.$cfg.minq='$minq'
set system.$cfg.maxq='$maxq'
set system.$cfg.offset='$offset'
set system.$cfg.factor='$factor'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_set_rssimon() {
local dev="$1"
local refresh="$2"
local threshold="$3"
local cfg="rssid_$dev"
uci -q get system.$cfg && return 0
uci batch <<EOF
set system.$cfg='rssid'
set system.$cfg.dev='$dev'
set system.$cfg.refresh='$refresh'
set system.$cfg.threshold='$threshold'
EOF
UCIDEF_LEDS_CHANGED=1
}
ucidef_commit_leds()
{
[ "$UCIDEF_LEDS_CHANGED" == "1" ] && uci commit system
}
ucidef_set_interface_loopback() {
uci batch <<EOF
set network.loopback='interface'
set network.loopback.ifname='lo'
set network.loopback.proto='static'
set network.loopback.ipaddr='127.0.0.1'
set network.loopback.netmask='255.0.0.0'
set network.globals='globals'
set network.globals.ula_prefix='auto'
EOF
}
ucidef_set_interface_raw() {
local cfg=$1
local ifname=$2
uci batch <<EOF
set network.$cfg='interface'
set network.$cfg.ifname='$ifname'
set network.$cfg.proto='none'
EOF
}
ucidef_set_interface_lan() {
local ifname=$1
uci batch <<EOF
set network.lan='interface'
set network.lan.ifname='$ifname'
set network.lan.type='bridge'
set network.lan.proto='static'
set network.lan.ipaddr='192.168.99.1'
set network.lan.netmask='255.255.255.0'
set network.lan.ip6assign='60'
EOF
}
ucidef_set_interface_wan() {
local ifname=$1
uci batch <<EOF
set network.wan='interface'
set network.wan.ifname='$ifname'
set network.wan.proto='dhcp'
set network.wan6='interface'
set network.wan6.ifname='@wan'
set network.wan6.proto='dhcpv6'
EOF
}
ucidef_set_interfaces_lan_wan() {
local lan_ifname=$1
local wan_ifname=$2
ucidef_set_interface_lan "$lan_ifname"
ucidef_set_interface_wan "$wan_ifname"
}
ucidef_set_interface_macaddr() {
local ifname=$1
local mac=$2
uci batch <<EOF
set network.$ifname.macaddr='$mac'
EOF
}
ucidef_add_switch() {
local name=$1
local reset=$2
local enable=$3
uci batch <<EOF
add network switch
set network.@switch[-1].name='$name'
set network.@switch[-1].reset='$reset'
set network.@switch[-1].enable_vlan='$enable'
EOF
}
ucidef_add_switch_vlan() {
local device=$1
local vlan=$2
local ports=$3
uci batch <<EOF
add network switch_vlan
set network.@switch_vlan[-1].device='$device'
set network.@switch_vlan[-1].vlan='$vlan'
set network.@switch_vlan[-1].ports='$ports'
EOF
}
|
zoyi/openwrt-ar71xx
|
package/base-files/files/lib/functions/uci-defaults.sh
|
Shell
|
gpl-2.0
| 4,444 |
#!/bin/sh
#
# Copyright (c) 2007 Johannes Schindelin
#
test_description='Test shared repository initialization'
. ./test-lib.sh
# User must have read permissions to the repo -> failure on --shared=0400
test_expect_success 'shared = 0400 (faulty permission u-w)' '
mkdir sub && (
cd sub && git init --shared=0400
)
ret="$?"
rm -rf sub
test $ret != "0"
'
for u in 002 022
do
test_expect_success "shared=1 does not clear bits preset by umask $u" '
mkdir sub && (
cd sub &&
umask $u &&
git init --shared=1 &&
test 1 = "$(git config core.sharedrepository)"
) &&
actual=$(ls -l sub/.git/HEAD)
case "$actual" in
-rw-rw-r--*)
: happy
;;
*)
echo Oops, .git/HEAD is not 0664 but $actual
false
;;
esac
'
rm -rf sub
done
test_expect_success 'shared=all' '
mkdir sub &&
cd sub &&
git init --shared=all &&
test 2 = $(git config core.sharedrepository)
'
test_expect_success 'update-server-info honors core.sharedRepository' '
: > a1 &&
git add a1 &&
test_tick &&
git commit -m a1 &&
umask 0277 &&
git update-server-info &&
actual="$(ls -l .git/info/refs)" &&
case "$actual" in
-r--r--r--*)
: happy
;;
*)
echo Oops, .git/info/refs is not 0444
false
;;
esac
'
for u in 0660:rw-rw---- \
0640:rw-r----- \
0600:rw------- \
0666:rw-rw-rw- \
0664:rw-rw-r--
do
x=$(expr "$u" : ".*:\([rw-]*\)") &&
y=$(echo "$x" | sed -e "s/w/-/g") &&
u=$(expr "$u" : "\([0-7]*\)") &&
git config core.sharedrepository "$u" &&
umask 0277 &&
test_expect_success "shared = $u ($y) ro" '
rm -f .git/info/refs &&
git update-server-info &&
actual="$(ls -l .git/info/refs)" &&
actual=${actual%% *} &&
test "x$actual" = "x-$y" || {
ls -lt .git/info
false
}
'
umask 077 &&
test_expect_success "shared = $u ($x) rw" '
rm -f .git/info/refs &&
git update-server-info &&
actual="$(ls -l .git/info/refs)" &&
actual=${actual%% *} &&
test "x$actual" = "x-$x" || {
ls -lt .git/info
false
}
'
done
test_expect_success 'git reflog expire honors core.sharedRepository' '
git config core.sharedRepository group &&
git reflog expire --all &&
actual="$(ls -l .git/logs/refs/heads/master)" &&
case "$actual" in
-rw-rw-*)
: happy
;;
*)
echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
false
;;
esac
'
test_done
|
vmiklos/gsoc2008
|
t/t1301-shared-repo.sh
|
Shell
|
gpl-2.0
| 2,320 |
#!/bin/sh
B2G_HOME=$(pwd)
DBG_CMD=""
if [ x"$DBG" != x"" ]; then
DBG_CMD="gdb -args"
fi
TAIL_ARGS=""
if [ x"$GDBSERVER" != x"" ]; then
TAIL_ARGS="$TAIL_ARGS -s -S"
fi
${DBG_CMD} $B2G_HOME/glue/gonk/out/host/linux-x86/bin/emulator \
-kernel $B2G_HOME/boot/kernel-android-qemu/arch/arm/boot/zImage \
-sysdir $B2G_HOME/glue/gonk/out/target/product/generic/ \
-data $B2G_HOME/glue/gonk/out/target/product/generic/userdata.img \
-memory 512 \
-partition-size 512 \
-skindir $B2G_HOME/glue/gonk/development/tools/emulator/skins \
-skin WVGA854 \
-verbose \
-qemu -cpu 'cortex-a8' $TAIL_ARGS
|
prajitdatta/OS-Testphas
|
emu.sh
|
Shell
|
gpl-2.0
| 620 |
#############
### This file defines functions required for printing text in color
#############
# Color code constants
# NOTE: These colors may not appear as their descriptions here under different terminals and terminal themes.
# For example, on gnome-terminal LIGHTGREEN actually appears same as green with bold font.
declare -A COLORS
COLORS["BLACK"]='\033[0;30m'
COLORS["BLUE"]='\033[0;34m'
COLORS["GREEN"]='\033[0;32m'
COLORS["CYAN"]='\033[0;36m'
COLORS["RED"]='\033[0;31m'
COLORS["PURPLE"]='\033[0;35m'
COLORS["BROWN"]='\033[0;33m'
COLORS["LIGHTGRAY"]='\033[0;37m'
COLORS["DARKGRAY"]='\033[1;30m'
COLORS["LIGHTBLUE"]='\033[1;34m'
COLORS["LIGHTGREEN"]='\033[1;32m'
COLORS["LIGHTCYAN"]='\033[1;36m'
COLORS["LIGHTRED"]='\033[1;31m'
COLORS["LIGHTPURPLE"]='\033[1;35m'
COLORS["YELLOW"]='\033[1;33m'
COLORS["WHITE"]='\033[1;37m'
COLORS["NC"]='\033[0m' # No Color
# TODO: put all these names into array. Then do a case insensitive, match on the names.
# Like sqlplus If user says echo kshitiz w it means white because only that starts with w
# If user says bl that is amgigious because two colors like that. You could also say lr for light red. Or even ld.
# Alternatively you could use _ as modifier to make color light.
color=$BLACK
# Enhancement of echo builtin that prints text in color.
# TODO: modify this function to print in bold if specified as echo kshitiz BLACK BOLD
# Sample code for printing in bold:
# bold=$(tput bold)
# normal=$(tput sgr0)
# echo "this is ${bold}bold${normal} but this isn't"
echoc() {
for arg in "$@"; do
printc "$arg "
done
echo
}
# Prints text providing color as argument instead of using default color set by setcolor
# Usage: echoc "text" color_code
# Example: echoc kshitiz red
_echoc() {
text="$1"
color_name="$2"
current_col=$CURRENT_COLOR
setcolor $color_name
echo "$text"
CURRENT_COLOR=$current_col
}
# Prints text in given color without new line. No printf style arguments accepted.
# Usage: printc "text" color_code
# Example: printc RED kshitiz
printc() {
color_name=`str_uppercase $1`
text="$2"
if [[ -z $color_name ]]; then
code=$CURRENT_COLOR
else
code=$(eval echo \$$color_name)
fi
printf "$code" # Set console color
printf "%s" "$text"
printf "$NC" # Restore console color, so as to not affect any other programs
}
# Changes the default color for echo
# Usage: setcolor color_name
# Example: setcolor RED
# TODO: add assertion to ensure that a valid color code is provided
setcolor() {
CURRENT_COLOR=$(eval echo \$$1)
}
# Prints the available color palette
color_palette() {
echoc BLACK BLACK
echoc BLUE BLUE
echoc GREEN GREEN
echoc CYAN CYAN
echoc RED RED
echoc PURPLE PURPLE
echoc BROWN BROWN
echoc LIGHTGRAY LIGHTGRAY
echoc DARKGRAY DARKGRAY
echoc LIGHTBLUE LIGHTBLUE
echoc LIGHTGREEN LIGHTGREEN
echoc LIGHTCYAN LIGHTCYAN
echoc LIGHTRED LIGHTRED
echoc LIGHTPURPLE LIGHTPURPLE
echoc YELLOW YELLOW
echoc WHITE WHITE
}
# kshitiz:~/.bash/scripts/system$ echo ${map[@]}
# cow
# kshitiz:~/.bash/scripts/system$ echo ${!map[@]}
# moo
# kshitiz:~/.bash/scripts/system$ echo map["moo"]
# map[moo]
# kshitiz:~/.bash/scripts/system$ echo ${map["MOO"]}
|
Kshitiz-Sharma/BashFramework
|
scripts/system/echo.sh
|
Shell
|
gpl-2.0
| 3,156 |
# Modify the variables below to match your project.
# This specifies the main site name in provisioning.
site_name='WordPress Multisite Subfolder - Not built yet (stable)'
# This sets up the name of the DB and the user and password for the DB.
database='wordpress_mupre'
dbuser='wp'
dbpass='wp'
# The site details for this network
domain='http://local.multisite-pre.dev'
admin_user='admin'
admin_pass='password'
admin_email='[email protected]'
|
wpsmith/vagrant
|
wordpress-mupre/site-vars.sh
|
Shell
|
gpl-2.0
| 446 |
#!/bin/sh
# Certain parts of this could be a lot better.
# The header doc parser -> db script will actually check modification
# date/times of the header file vs. whats in the database, which
# was added to do make style only update on change. But the whole
# thing, from db creation, parsing, to generating the html files
# only takes a few seconds so it rebuilds the whole thing from
# scratch each time. headerdoc2html + gatherheaderdoc would
# drag on and on and on...
export DOCUMENTATION_CHECK_HTML_SCRIPT=${DOCUMENTATION_CHECK_HTML_SCRIPT:?"error: Environment variable DOCUMENTATION_CHECK_HTML_SCRIPT must exist, aborting."}
export DOCUMENTATION_CHECK_SPELLING_SCRIPT=${DOCUMENTATION_CHECK_SPELLING_SCRIPT:?"error: Environment variable DOCUMENTATION_CHECK_SPELLING_SCRIPT must exist, aborting."}
export DOCUMENTATION_GENERATE_HTML_SCRIPT=${DOCUMENTATION_GENERATE_HTML_SCRIPT:?"error: Environment variable DOCUMENTATION_GENERATE_HTML_SCRIPT must exist, aborting."}
export DOCUMENTATION_PARSE_HEADERS_SCRIPT=${DOCUMENTATION_PARSE_HEADERS_SCRIPT:?"error: Environment variable DOCUMENTATION_PARSE_HEADERS_SCRIPT must exist, aborting."}
export DOCUMENTATION_RESOLVE_LINKS_SCRIPT=${DOCUMENTATION_RESOLVE_LINKS_SCRIPT:?"error: Environment variable DOCUMENTATION_RESOLVE_LINKS_SCRIPT must exist, aborting."}
export DOCUMENTATION_RESOURCES_DIR=${DOCUMENTATION_RESOURCES_DIR:?"error: Environment variable DOCUMENTATION_RESOURCES_DIR must exist, aborting."}
export DOCUMENTATION_SOURCE_DIR=${DOCUMENTATION_SOURCE_DIR:?"error: Environment variable DOCUMENTATION_SOURCE_DIR must exist, aborting."}
export DOCUMENTATION_SQL_DATABASE_DIR=${DOCUMENTATION_SQL_DATABASE_DIR:?"error: Environment variable DOCUMENTATION_SQL_DATABASE_DIR must exist, aborting."}
export DOCUMENTATION_SQL_DATABASE_FILE=${DOCUMENTATION_SQL_DATABASE_FILE:?"error: Environment variable DOCUMENTATION_SQL_DATABASE_FILE must exist, aborting."}
export DOCUMENTATION_SQL_DIR=${DOCUMENTATION_SQL_DIR:?"error: Environment variable DOCUMENTATION_SQL_DIR must exist, aborting."}
export DOCUMENTATION_SQL_INIT_FILE=${DOCUMENTATION_SQL_INIT_FILE:?"error: Environment variable DOCUMENTATION_SQL_INIT_FILE must exist, aborting."}
export DOCUMENTATION_SQL_CONFIG_FILE=${DOCUMENTATION_SQL_CONFIG_FILE:?"error: Environment variable DOCUMENTATION_SQL_CONFIG_FILE must exist, aborting."}
export DOCUMENTATION_TARGET_DIR=${DOCUMENTATION_TARGET_DIR:?"error: Environment variable DOCUMENTATION_TARGET_DIR must exist, aborting."}
export DOCUMENTATION_TEMP_DIR=${DOCUMENTATION_TEMP_DIR:?"error: Environment variable DOCUMENTATION_TEMP_DIR must exist, aborting."}
export DOCUMENTATION_TEMPLATES_DIR=${DOCUMENTATION_TEMPLATES_DIR:?"error: Environment variable DOCUMENTATION_TEMPLATES_DIR must exist, aborting."}
export PCRE_INSTALL_DIR=${PCRE_INSTALL_DIR:?"error: Environment variable PCRE_INSTALL_DIR must exist, aborting."}
export PCRE_HTML_DIR=${PCRE_HTML_DIR:?"error: Environment variable PCRE_HTML_DIR must exist, aborting."}
export PERL=${PERL:?"Environment variable PERL must exist, aborting."}
export PROJECT_HEADERS_DIR=${PROJECT_HEADERS_DIR:?"Environment variable PROJECT_HEADERS_DIR must exist, aborting."}
export PROJECT_NAME=${PROJECT_NAME:?"Environment variable PROJECT_NAME must exist, aborting."}
export RSYNC=${RSYNC:?"Environment variable RSYNC must exist, aborting."}
export SQLITE=${SQLITE:?"Environment variable SQLITE must exist, aborting."}
if [ "${XCODE_VERSION_MAJOR}" == "0200" ]; then
echo "$0:$LINENO: warning: DocSet is only supported on Xcode 3.0 and above.";
exit 0;
fi
"${PERL}" -e 'require DBD::SQLite;' >/dev/null 2>&1
if [ $? != 0 ]; then echo "$0:$LINENO: error: The perl module 'DBD::SQLite' must be installed in order to build the the target '${TARGETNAME}'."; exit 1; fi;
TIMESTAMP_FILE="${DOCUMENTATION_DOCSET_TEMP_DIR}/buildDocSet_timestamp"
DOCS_UP_TO_DATE="No";
if [ -f "${TIMESTAMP_FILE}" ]; then
DOCS_UP_TO_DATE="Yes";
if [ ! -d "${DOCUMENTATION_DOCSET_TARGET_DIR}" ]; then DOCS_UP_TO_DATE="No"; fi;
NEWER_FILES=`"${FIND}" "${PROJECT_HEADERS_DIR}" -newer "${TIMESTAMP_FILE}"`;
if [ "${NEWER_FILES}" != "" ]; then DOCS_UP_TO_DATE="No"; fi;
NEWER_FILES=`"${FIND}" "${DOCUMENTATION_DOCSET_SOURCE_HTML}" -newer "${TIMESTAMP_FILE}"`;
if [ "${NEWER_FILES}" != "" ]; then DOCS_UP_TO_DATE="No"; fi;
NEWER_FILES=`"${FIND}" "${DOCUMENTATION_SOURCE_DIR}" -newer "${TIMESTAMP_FILE}"`;
if [ "${NEWER_FILES}" != "" ]; then DOCS_UP_TO_DATE="No"; fi;
if [ $DOCS_UP_TO_DATE == "No" ]; then echo "$0:$LINENO: note: There are newer source files, rebuilding DocSet."; fi;
fi;
if [ $DOCS_UP_TO_DATE == "Yes" ]; then echo "$0:$LINENO: note: DocSet files are up to date."; exit 0; fi;
# Clear the time stamp. It will be recreated if we are successful.
rm -f "${TIMESTAMP_FILE}"
DOCSETUTIL="${DEVELOPER_BIN_DIR}/docsetutil"
# Used by some scripts we call to report the error location as this shell script. Sets LINENO when necessary.
export SCRIPT_NAME="$0";
# Scripts that do work for us.
if [ ! -x "${DOCUMENTATION_CREATE_DOCSET_SCRIPT}" ]; then echo "$0:$LINENO: error: The command 'createDocSet.pl' does not exist at '${DOCUMENTATION_CREATE_DOCSET_SCRIPT}'."; exit 1; fi;
# Create the documentation directory if it doesn't exist, and if it does clean it out and start fresh
if [ ! -d "${DOCUMENTATION_DOCSET_TARGET_DIR}" ]; then
mkdir "${DOCUMENTATION_DOCSET_TARGET_DIR}"
else
rm -rf "${DOCUMENTATION_DOCSET_TARGET_DIR}"
mkdir "${DOCUMENTATION_DOCSET_TARGET_DIR}"
fi
rm -rf "${DOCUMENTATION_DOCSET_TEMP_DOCS_DIR}"
mkdir -p "${DOCUMENTATION_DOCSET_TEMP_DOCS_DIR}" && \
"${RSYNC}" -a --delete --cvs-exclude "${DOCUMENTATION_DOCSET_SOURCE_HTML}/" "${DOCUMENTATION_DOCSET_TEMP_DOCS_DIR}"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: Unable to create temporary DocSet build area directory."; exit 1; fi;
# We always wipe our tables and start fresh so we have semi-consistant ID's
"${SQLITE}" "${DOCUMENTATION_SQL_DATABASE_FILE}" < "${DOCUMENTATION_SQL_DIR}/docset.sql"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: SQL database prep for DocSet failed."; exit 1; fi;
# Execute the DOCUMENTATION_CREATE_DOCSET_SCRIPT script.
echo "$0:$LINENO: note: Creating DocSet '${DOCUMENTATION_DOCSET_ID}'."
"${DOCUMENTATION_CREATE_DOCSET_SCRIPT}"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: DocSet generation failed."; exit 1; fi;
# We lint what we've generated through the docset relaxng schemas to catch
# any mistakes.
DOCSETACCESS_FRAMEWORK="/Developer/Library/PrivateFrameworks/DocSetAccess.framework/Resources"
if [ -x xmllint ] && [ -r "${DOCSETACCESS_FRAMEWORK}/NodesSchema.rng" ]; then
xmllint --noout --relaxng "${DOCSETACCESS_FRAMEWORK}/NodesSchema.rng" "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}/Contents/Resources/Nodes.xml"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: DocSet Nodes.xml failed validation test."; exit 1; fi;
fi;
if [ -x xmllint ] && [ -r "${DOCSETACCESS_FRAMEWORK}/TokensSchema.rng" ]; then
xmllint --noout --relaxng "${DOCSETACCESS_FRAMEWORK}/TokensSchema.rng" "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}/Contents/Resources/Tokens.xml"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: DocSet Tokens.xml failed validation test."; exit 1; fi;
fi
# 'validate' complains about a lot of things. I think it's from the very poor
# 'nodes' schema. It doesn't seem to be broken in practice.
"${DOCSETUTIL}" validate "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: The 'docsetutil' command did not successfully validate the DocSet."; exit 1; fi;
echo "$0:$LINENO: note: Indexing DocSet '${DOCUMENTATION_DOCSET_ID}'."
"${DOCSETUTIL}" index "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}" &&
mv "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}/Contents/Resources/Nodes.xml" "${DOCUMENTATION_DOCSET_TEMP_DIR}" &&
mv "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}/Contents/Resources/Tokens.xml" "${DOCUMENTATION_DOCSET_TEMP_DIR}"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: DocSet indexing failed."; exit 1; fi;
echo "$0:$LINENO: note: Packaging DocSet as '${DOCUMENTATION_DOCSET_PACKAGED_FILE}'."
"${DOCSETUTIL}" package -output "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_PACKAGED_FILE}" "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: DocSet packaging failed."; exit 1; fi;
mkdir -p "${DOCUMENTATION_DOCSET_TARGET_DIR}/${DOCUMENTATION_DOCSET_ID}" &&
"${RSYNC}" -a --delete --cvs-exclude "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_ID}/" "${DOCUMENTATION_DOCSET_TARGET_DIR}/${DOCUMENTATION_DOCSET_ID}" &&
"${RSYNC}" -a --delete --cvs-exclude "${DOCUMENTATION_DOCSET_TEMP_DIR}/${DOCUMENTATION_DOCSET_PACKAGED_FILE}" "${DOCUMENTATION_DOCSET_TARGET_DIR}"
if [ $? != 0 ] ; then echo "$0:$LINENO: error: Unable top copy the created DocSet to its final location."; exit 1; fi;
echo "$0:$LINENO: note: Clean build, touching timestamp.";
touch "${TIMESTAMP_FILE}";
|
beinstein/baseten
|
Contrib/RegexKit/RegexKit-0.6.0-source/Source/Documentation/Scripts/buildDocSet.sh
|
Shell
|
gpl-2.0
| 9,045 |
convert images/OCS-584-A.png -crop 1556x4620+119+281 +repage images/OCS-584-A.png
#
#
#/OCS-584.png
convert images/OCS-584-B.png -crop 1543x4602+91+277 +repage images/OCS-584-B.png
#
#
#/OCS-584.png
|
jonnymwalker/Staroslavjanskij-Slovar
|
scripts/cropedges.OCS-584.sh
|
Shell
|
gpl-2.0
| 199 |
# export AWS_ACCESS_KEY="Your-Access-Key"
# export AWS_SECRET_KEY="Your-Secret-Key"
today=`date +"%d-%m-%Y","%T"`
logfile="/awslog/ec2-access.log"
# Grab all Security Groups IDs for ALLOW action and export the IDs to a text file
sudo aws ec2 describe-security-groups --filters Name=tag:open-ssh-time,Values=05-00 Name=tag:bash-profile,Values=ad --query SecurityGroups[].[GroupId] --output text > ~/tmp/allowssh_ad_info.txt 2>&1
# Take list of changing security groups
for group_id in $(cat ~/tmp/allowssh_ad_info.txt)
do
# Change rules in security group
sudo aws ec2 authorize-security-group-ingress --group-id $group_id --protocol tcp --port 3389 --cidr 0.0.0.0/0
# Put info into log file
echo Attempt $today allow access to instances with attached group $group_id for SSH >> $logfile
done
|
STARTSPACE/aws-access-to-ec2-by-timetable
|
ssh-22/allow-ad/ssh-allow-ad-05.sh
|
Shell
|
gpl-2.0
| 797 |
#!/bin/bash
F_SOURCE=$1
D_TARGET=$2
if [ ! ${NAME} -o ! ${D_TARGET} ]; then
echo 'usage: "main.sh <logFile> <targetDir>"'
exit
fi
if [ -a ${D_TARGET} ]; then
echo 'target directory is existing, exiting.'
exit
fi
mkdir -p ${D_TARGET}
F_LOG=${D_TARGET}/benchmark.log
F_DATA=${D_TARGET}/requests.dat
F_ERR=${D_TARGET}/errors.dat
# extract single log
tac ${F_SOURCE} | sed '/will now attack/q' | tac > ${F_LOG}
# separate valid data from errors
grep -e "Exception" -e "exception" -e "timed out" -e "null" ${F_LOG} > ${F_ERR}
grep -v -e "Exception" -e "exception" -e "timed out" -e "null" -e "AsyncClient" -e "limit reached" ${F_LOG} |
awk '{if(NR==1){delta=$1};$1=$1-delta;print $1,$9,$10,$11,$12}' | grep -v "-" > ${F_DATA}
# sort in seconds
F_DPS=${D_TARGET}/requests-s.dat
awk '{print int($1/1000),$2,$3,$4,$5}' ${F_DATA} | sort -s -n -k 1,1 > ${F_DPS}
# throughput
F_TRO=${D_TARGET}/throughput.dat
awk '{if(NR==1){second=0}if(second!=$1){ttro=ttro+tro;print second,tro,ttro;second=$1;tro=0}tro=tro+1} END {print second,tro}' ${F_DPS} > ${F_TRO}
# average request latencies
F_AVGLAT=${D_TARGET}/avg-latencies.dat
awk '{if(NR==1){second=0}if(second!=$1){print second,num,lat/num;second=$1;num=0;lat=0}lat=lat+$3;num=num+1} END {print second,num,lat/num}' ${F_DPS} > ${F_AVGLAT}
# overall statistics
F_STATS=${D_TARGET}/stats.dat
awk '{if(second!=$1){second=$1;numb=numb+1}lat=lat+$3;num=num+1} END {print num,num/numb,lat/num}' ${F_DPS} > ${F_STATS}
# create plots
pushd ${D_TARGET} 2>&1 /dev/null
gnuplot -e "filename='avg-latencies.dat'" ../../../plot-avglatencies.p
gnuplot -e "filename='throughput.dat'" ../../../plot-throughput.p
popd 2>&1 /dev/null
exit
gnuplot -e "filename='num-requests.dat'" ../plot-numrequests.p
|
sebschlicht/bachelor-thesis
|
plotting/extract-log.sh
|
Shell
|
gpl-2.0
| 1,742 |
#!/bin/bash
#
# Run select tests by setting ONLY, or as arguments to the script.
# Skip specific tests by setting EXCEPT.
#
# Run test by setting NOSETUP=true when ltest has setup env for us
set -e
#kernel 2.4.x doesn't support quota
K_VER=`uname --kernel-release | cut -b 1-3`
if [ $K_VER = "2.4" ]; then
echo "Kernel 2.4 doesn't support quota"
exit 0
fi
SRCDIR=`dirname $0`
export PATH=$PWD/$SRCDIR:$SRCDIR:$PWD/$SRCDIR/../utils:$PATH:/sbin
ONLY=${ONLY:-"$*"}
# test_11 has been used to protect a kernel bug(bz10912), now it isn't
# useful any more. Then add it to ALWAYS_EXCEPT. b=19835
# We have changed the mechanism of quota, test_12 is meanless now.
# b=20877
ALWAYS_EXCEPT="10 12 $SANITY_QUOTA_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
case `uname -r` in
2.6*) FSTYPE=${FSTYPE:-ldiskfs};;
*) error "unsupported kernel" ;;
esac
[ "$ALWAYS_EXCEPT$EXCEPT" ] && \
echo "Skipping tests: `echo $ALWAYS_EXCEPT $EXCEPT`"
TMP=${TMP:-/tmp}
ORIG_PWD=${PWD}
TSTID=${TSTID:-60000}
TSTID2=${TSTID2:-60001}
TSTUSR=${TSTUSR:-"quota_usr"}
TSTUSR2=${TSTUSR2:-"quota_2usr"}
BLK_SZ=1024
BUNIT_SZ=${BUNIT_SZ:-1024} # min block quota unit(kB)
IUNIT_SZ=${IUNIT_SZ:-10} # min inode quota unit
MAX_DQ_TIME=604800
MAX_IQ_TIME=604800
SANITY_QUOTA_USERS="quota15_1 quota15_2 quota15_3 quota15_4 quota15_5 quota15_6 \
quota15_7 quota15_8 quota15_9 quota15_10 quota15_11 quota15_12 \
quota15_13 quota15_14 quota15_15 quota15_16 quota15_17 quota15_18 \
quota15_19 quota15_20 quota15_21 quota15_22 quota15_23 quota15_24 \
quota15_25 quota15_26 quota15_27 quota15_28 quota15_29 quota15_30"
TRACE=${TRACE:-""}
LUSTRE=${LUSTRE:-`dirname $0`/..}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
init_logging
DIRECTIO=${DIRECTIO:-$LUSTRE/tests/directio}
[ $MDSCOUNT -gt 1 ] && skip "CMD case" && exit 0
require_dsh_mds || exit 0
require_dsh_ost || exit 0
[ "$SLOW" = "no" ] && EXCEPT_SLOW="9 10 11 18b 21"
QUOTALOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
[ "$QUOTALOG" ] && rm -f $QUOTALOG || true
DIR=${DIR:-$MOUNT}
DIR2=${DIR2:-$MOUNT2}
QUOTA_AUTO_OLD=$QUOTA_AUTO
export QUOTA_AUTO=0
check_and_setup_lustre
LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
SHOW_QUOTA_USER="$LFS quota -v -u $TSTUSR $DIR"
SHOW_QUOTA_USERID="$LFS quota -v -u $TSTID $DIR"
SHOW_QUOTA_USER2="$LFS quota -v -u $TSTUSR2 $DIR"
SHOW_QUOTA_GROUP="$LFS quota -v -g $TSTUSR $DIR"
SHOW_QUOTA_GROUPID="$LFS quota -v -g $TSTID $DIR"
SHOW_QUOTA_GROUP2="$LFS quota -v -g $TSTUSR2 $DIR"
SHOW_QUOTA_INFO_USER="$LFS quota -t -u $DIR"
SHOW_QUOTA_INFO_GROUP="$LFS quota -t -g $DIR"
# control the time of tests
cycle=30
[ "$SLOW" = "no" ] && cycle=10
build_test_filter
# set_blk_tunables(btune_sz)
set_blk_tunesz() {
local btune=$(($1 * BLK_SZ))
# set btune size on all obdfilters
do_nodes $(comma_list $(osts_nodes)) "lctl set_param lquota.${FSNAME}-OST*.quota_btune_sz=$btune"
# set btune size on mds
do_facet $SINGLEMDS "lctl set_param lquota.mdd_obd-${FSNAME}-MDT*.quota_btune_sz=$btune"
}
# set_blk_unitsz(bunit_sz)
set_blk_unitsz() {
local bunit=$(($1 * BLK_SZ))
# set bunit size on all obdfilters
do_nodes $(comma_list $(osts_nodes)) "lctl set_param lquota.${FSNAME}-OST*.quota_bunit_sz=$bunit"
# set bunit size on mds
do_facet $SINGLEMDS "lctl set_param lquota.mdd_obd-${FSNAME}-MDT*.quota_bunit_sz=$bunit"
}
# set_file_tunesz(itune_sz)
set_file_tunesz() {
local itune=$1
# set itune size on mds
do_facet $SINGLEMDS "lctl set_param lquota.mdd_obd-${FSNAME}-MDT*.quota_itune_sz=$itune"
}
# set_file_unitsz(iunit_sz)
set_file_unitsz() {
local iunit=$1
# set iunit size on mds
do_facet $SINGLEMDS "lctl set_param lquota.mdd_obd-${FSNAME}-MDT*.quota_iunit_sz=$iunit"
}
lustre_fail() {
local fail_node=$1
local fail_loc=$2
local fail_val=${3:-0}
if [ $fail_node == "mds" ] || [ $fail_node == "mds_ost" ]; then
if [ $((fail_loc & 0x10000000)) -ne 0 -a $fail_val -gt 0 ] || \
[ $((fail_loc)) -eq 0 ]; then
do_facet $SINGLEMDS "lctl set_param fail_val=$fail_val"
fi
do_facet $SINGLEMDS "lctl set_param fail_loc=$fail_loc"
fi
if [ $fail_node == "ost" ] || [ $fail_node == "mds_ost" ]; then
for num in `seq $OSTCOUNT`; do
if [ $((fail_loc & 0x10000000)) -ne 0 -a $fail_val -gt 0 ] || \
[ $((fail_loc)) -eq 0 ]; then
do_facet ost$num "lctl set_param fail_val=$fail_val"
fi
do_facet ost$num "lctl set_param fail_loc=$fail_loc"
done
fi
}
RUNAS="runas -u $TSTID -g $TSTID"
RUNAS2="runas -u $TSTID2 -g $TSTID2"
FAIL_ON_ERROR=true check_runas_id $TSTID $TSTID $RUNAS
FAIL_ON_ERROR=true check_runas_id $TSTID2 $TSTID2 $RUNAS2
FAIL_ON_ERROR=false
run_test_with_stat() {
(($# != 2)) && error "the number of arguments is wrong"
do_facet $SINGLEMDS "lctl set_param lquota.mdd_obd-${FSNAME}-MDT*.stats=0" > /dev/null
for j in `seq $OSTCOUNT`; do
do_facet ost$j "lctl set_param lquota.${FSNAME}-OST*.stats=0" > /dev/null
done
run_test "$@"
if [ ${STAT:-"yes"} != "no" -a -z "$LAST_SKIPPED" ]; then
echo "statistics info begin ***************************************"
do_facet $SINGLEMDS "lctl get_param lquota.mdd_obd-${FSNAME}-MDT*.stats"
for j in `seq $OSTCOUNT`; do
do_facet ost$j "lctl get_param lquota.${FSNAME}-OST*.stats"
done
echo "statistics info end ***************************************"
fi
}
#
# clear quota limits for a user or a group
# usage: resetquota -u username
# resetquota -g groupname
resetquota() {
[ "$#" != 2 ] && error "resetquota: wrong number of arguments: $#"
[ "$1" != "-u" -a "$1" != "-g" ] && error "resetquota: wrong specifier $1 passed"
count=0
if at_is_enabled; then
timeout=$(at_max_get mds)
else
timeout=$(lctl get_param -n timeout)
fi
while [ $((count++)) -lt $timeout ]; do
local RC=0
OUTPUT=`$LFS setquota "$1" "$2" -b 0 -B 0 -i 0 -I 0 $MOUNT 2>&1` || RC=${PIPESTATUS[0]}
if [ $RC -ne 0 ]; then
if echo "$OUTPUT" | grep -q busy; then
log "resetquota is blocked for quota master recovery, retry after $((count * 3)) sec"
sleep 3
continue
else
error "resetquota failed"
fi
fi
break
done
[ $count -lt $timeout ] || error "resetquota timeout: $timeout"
}
quota_scan() {
LOCAL_UG=$1
LOCAL_ID=$2
if [ "$LOCAL_UG" == "a" -o "$LOCAL_UG" == "u" ]; then
log "Files for user ($LOCAL_ID):"
($LFS find -user $LOCAL_ID $DIR | xargs stat 2>/dev/null)
fi
if [ "$LOCAL_UG" == "a" -o "$LOCAL_UG" == "g" ]; then
log "Files for group ($LOCAL_ID):"
($LFS find -group $LOCAL_ID $DIR | xargs stat 2>/dev/null)
fi
}
quota_error() {
quota_scan $1 $2
shift 2
error "$*"
}
quota_log() {
quota_scan $1 $2
shift 2
log "$*"
}
#
# get quota info for a user or a group
# usage: getquota -u|-g <username>|<groupname> global|<obd_uuid> bhardlimit|bsoftlimit|bgrace|ihardlimit|isoftlimit|igrace
#
getquota() {
local spec
local uuid
[ "$#" != 4 ] && error "getquota: wrong number of arguments: $#"
[ "$1" != "-u" -a "$1" != "-g" ] && error "getquota: wrong u/g specifier $1 passed"
uuid="$3"
case "$4" in
curspace) spec=1;;
bsoftlimit) spec=2;;
bhardlimit) spec=3;;
bgrace) spec=4;;
curinodes) spec=5;;
isoftlimit) spec=6;;
ihardlimit) spec=7;;
igrace) spec=8;;
*) error "unknown quota parameter $4";;
esac
[ "$uuid" = "global" ] && uuid=$DIR
$LFS quota -v "$1" "$2" $DIR | awk 'BEGIN { num='$spec' } { if ($1 == "'$uuid'") { if (NF == 1) { getline } else { num++ } ; print $num;} }' | tr -d "*"
}
quota_show_check() {
LOCAL_BF=$1
LOCAL_UG=$2
LOCAL_ID=$3
PATTERN="`echo $DIR | sed 's/\//\\\\\//g'`"
$LFS quota -v -$LOCAL_UG $LOCAL_ID $DIR
if [ "$LOCAL_BF" == "a" -o "$LOCAL_BF" == "b" ]; then
USAGE=`getquota -$LOCAL_UG $LOCAL_ID global curspace`
if [ -z $USAGE ]; then
quota_error $LOCAL_UG $LOCAL_ID "System is error when query quota for block ($LOCAL_UG:$LOCAL_ID)."
else
[ $USAGE -ne 0 ] && quota_log $LOCAL_UG $LOCAL_ID "System is not clean for block ($LOCAL_UG:$LOCAL_ID:$USAGE)."
fi
fi
if [ "$LOCAL_BF" == "a" -o "$LOCAL_BF" == "f" ]; then
USAGE=`getquota -$LOCAL_UG $LOCAL_ID global curinodes`
if [ -z $USAGE ]; then
quota_error $LOCAL_UG $LOCAL_ID "System is error when query quota for file ($LOCAL_UG:$LOCAL_ID)."
else
[ $USAGE -ne 0 ] && quota_log $LOCAL_UG $LOCAL_ID "System is not clean for file ($LOCAL_UG:$LOCAL_ID:$USAGE)."
fi
fi
}
# set quota
quota_init() {
do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+quota"
log "do the quotacheck ..."
$LFS quotacheck -ug $DIR
resetquota -u $TSTUSR
resetquota -g $TSTUSR
}
quota_init
test_quota_performance() {
TESTFILE="$DIR/$tdir/$tfile-0"
local size=$1
local stime=`date +%s`
$RUNAS dd if=/dev/zero of=$TESTFILE bs=1M count=$size || quota_error u $TSTUSR "write failure"
local etime=`date +%s`
delta=$((etime - stime))
if [ $delta -gt 0 ]; then
rate=$((size * 1024 / delta))
[ $rate -gt 1024 ] || error "SLOW IO for $TSTUSR (user): $rate KB/sec"
fi
rm -f $TESTFILE
}
# test basic quota performance b=21696
test_0() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
MB=100
[ "$SLOW" = "no" ] && MB=10
test_quota_performance $MB
$LFS setquota -u $TSTUSR -b 0 -B $((1024*1024)) -i 0 -I 0 $DIR
test_quota_performance $MB
resetquota -u $TSTUSR
}
run_test_with_stat 0 "Test basic quota performance ==="
# test for specific quota limitation, qunit, qtune $1=block_quota_limit
test_1_sub() {
LIMIT=$1
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
wait_delete_completed
# test for user
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
sleep 3
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
log " Write ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(($LIMIT/2)) || quota_error u $TSTUSR "(usr) write failure, but expect success"
log " Done"
log " Write out of block quota ..."
# this time maybe cache write, ignore it's failure
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(($LIMIT/2)) seek=$(($LIMIT/2)) || true
# flush cache, ensure noquota flag is setted on client
cancel_lru_locks osc
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$BUNIT_SZ seek=$LIMIT && quota_error u $TSTUSR "(usr) write success, but expect EDQUOT"
rm -f $TESTFILE
sync; sleep 1; sync;
OST0_UUID=`do_facet ost1 $LCTL dl | grep -m1 obdfilter | awk '{print $((NF-1))}'`
OST0_QUOTA_USED=`getquota -u $TSTUSR $OST0_UUID curspace`
echo $OST0_QUOTA_USED
[ $OST0_QUOTA_USED -ne 0 ] && \
($SHOW_QUOTA_USER; quota_error u $TSTUSR "(usr) quota deleted isn't released")
$SHOW_QUOTA_USER
resetquota -u $TSTUSR
# test for group
log "--------------------------------------"
log " Group quota (limit: $LIMIT kbytes)"
$LFS setquota -g $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
sleep 3
quota_show_check b g $TSTUSR
TESTFILE="$DIR/$tdir/$tfile-1"
$LFS setstripe $TESTFILE -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
log " Write ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(($LIMIT/2)) || quota_error g $TSTUSR "(grp) write failure, but expect success"
log " Done"
log " Write out of block quota ..."
# this time maybe cache write, ignore it's failure
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(($LIMIT/2)) seek=$(($LIMIT/2)) || true
cancel_lru_locks osc
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$BUNIT_SZ seek=$LIMIT && quota_error g $TSTUSR "(grp) write success, but expect EDQUOT"
# cleanup
rm -f $TESTFILE
sync; sleep 1; sync;
OST0_UUID=`do_facet ost1 $LCTL dl | grep -m1 obdfilter | awk '{print $((NF-1))}'`
OST0_QUOTA_USED=`getquota -g $TSTUSR $OST0_UUID curspace`
echo $OST0_QUOTA_USED
[ $OST0_QUOTA_USED -ne 0 ] && \
($SHOW_QUOTA_GROUP; quota_error g $TSTUSR "(grp) quota deleted isn't released")
$SHOW_QUOTA_GROUP
resetquota -g $TSTUSR
}
# block hard limit (normal use and out of quota)
test_1() {
for i in `seq 1 $cycle`; do
# define blk_qunit is between 1M and 4M
blk_qunit=$(( $RANDOM % 3072 + 1024 ))
blk_qtune=$(( $RANDOM % $blk_qunit ))
# other osts and mds will occupy at 1M blk quota
b_limit=$(( ($RANDOM - 16384) / 8 + ($OSTCOUNT + 1) * $blk_qunit * 4 ))
set_blk_tunesz $blk_qtune
set_blk_unitsz $blk_qunit
echo "cycle: $i(total $cycle) bunit:$blk_qunit, btune:$blk_qtune, blimit:$b_limit"
test_1_sub $b_limit
echo "=================================================="
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
done
}
run_test_with_stat 1 "Block hard limit (normal use and out of quota) ==="
# test for specific quota limitation, qunit, qtune $1=block_quota_limit
test_2_sub() {
LIMIT=$1
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
wait_delete_completed
# test for user
log " User quota (limit: $LIMIT files)"
$LFS setquota -u $TSTUSR -b 0 -B 0 -i 0 -I $LIMIT $DIR
sleep 3
quota_show_check f u $TSTUSR
log " Create $LIMIT files ..."
$RUNAS createmany -m ${TESTFILE} $LIMIT || \
quota_error u $TSTUSR "(usr) create failure, but expect success"
log " Done"
log " Create out of file quota ..."
$RUNAS touch ${TESTFILE}_xxx && \
quota_error u $TSTUSR "(usr) touch success, but expect EDQUOT"
unlinkmany ${TESTFILE} $LIMIT
rm -f ${TESTFILE}_xxx
sync; sleep 1; sync;
MDS_UUID=`do_facet $SINGLEMDS $LCTL dl | grep -m1 " mdt " | awk '{print $((NF-1))}'`
MDS_QUOTA_USED=`getquota -u $TSTUSR $MDS_UUID curinodes`
echo $MDS_QUOTA_USED
[ $MDS_QUOTA_USED -ne 0 ] && \
($SHOW_QUOTA_USER; quota_error u $TSTUSR "(usr) quota deleted isn't released")
$SHOW_QUOTA_USER
resetquota -u $TSTUSR
# test for group
log "--------------------------------------"
log " Group quota (limit: $LIMIT FILE)"
$LFS setquota -g $TSTUSR -b 0 -B 0 -i 0 -I $LIMIT $DIR
sleep 3
quota_show_check f g $TSTUSR
TESTFILE=$DIR/$tdir/$tfile-1
log " Create $LIMIT files ..."
$RUNAS createmany -m ${TESTFILE} $LIMIT || \
quota_error g $TSTUSR "(grp) create failure, but expect success"
log " Done"
log " Create out of file quota ..."
$RUNAS touch ${TESTFILE}_xxx && \
quota_error g $TSTUSR "(grp) touch success, but expect EDQUOT"
unlinkmany ${TESTFILE} $LIMIT
rm -f ${TESTFILE}_xxx
sync; sleep 1; sync;
MDS_UUID=`do_facet $SINGLEMDS $LCTL dl | grep -m1 " mdt " | awk '{print $((NF-1))}'`
MDS_QUOTA_USED=`getquota -g $TSTUSR $MDS_UUID curinodes`
echo $MDS_QUOTA_USED
[ $MDS_QUOTA_USED -ne 0 ] && \
($SHOW_QUOTA_GROUP; quota_error g $TSTUSR "(grp) quota deleted isn't released")
$SHOW_QUOTA_GROUP
resetquota -g $TSTUSR
}
# file hard limit (normal use and out of quota)
test_2() {
for i in `seq 1 $cycle`; do
if [ $i -eq 1 ]; then
ino_qunit=52
ino_qtune=41
i_limit=11
else
# define ino_qunit is between 10 and 100
ino_qunit=$(( $RANDOM % 90 + 10 ))
ino_qtune=$(( $RANDOM % $ino_qunit ))
# RANDOM's maxium is 32767
i_limit=$(( $RANDOM % 990 + 10 ))
fi
set_file_tunesz $ino_qtune
set_file_unitsz $ino_qunit
echo "cycle: $i(total $cycle) iunit:$ino_qunit, itune:$ino_qtune, ilimit:$i_limit"
test_2_sub $i_limit
echo "=================================================="
set_file_unitsz 5120
set_file_tunesz 2560
done
}
run_test_with_stat 2 "File hard limit (normal use and out of quota) ==="
test_block_soft() {
TESTFILE=$1
TIMER=$(($2 * 3 / 2))
OFFSET=0
wait_delete_completed
echo " Write to exceed soft limit"
RUNDD="$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ"
$RUNDD count=$((BUNIT_SZ+1)) || \
quota_error a $TSTUSR "write failure, but expect success"
OFFSET=$((OFFSET + BUNIT_SZ + 1))
cancel_lru_locks osc
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$SHOW_QUOTA_INFO_USER
$SHOW_QUOTA_INFO_GROUP
echo " Write before timer goes off"
$RUNDD count=$BUNIT_SZ seek=$OFFSET || \
quota_error a $TSTUSR "write failure, but expect success"
OFFSET=$((OFFSET + BUNIT_SZ))
cancel_lru_locks osc
echo " Done"
echo " Sleep $TIMER seconds ..."
sleep $TIMER
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$SHOW_QUOTA_INFO_USER
$SHOW_QUOTA_INFO_GROUP
echo " Write after timer goes off"
# maybe cache write, ignore.
$RUNDD count=$BUNIT_SZ seek=$OFFSET || true
OFFSET=$((OFFSET + BUNIT_SZ))
cancel_lru_locks osc
$RUNDD count=$BUNIT_SZ seek=$OFFSET && \
quota_error a $TSTUSR "write success, but expect EDQUOT"
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$SHOW_QUOTA_INFO_USER
$SHOW_QUOTA_INFO_GROUP
echo " Unlink file to stop timer"
rm -f $TESTFILE
sync; sleep 1; sync
echo " Done"
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$SHOW_QUOTA_INFO_USER
$SHOW_QUOTA_INFO_GROUP
echo " Write ..."
$RUNDD count=$BUNIT_SZ || quota_error a $TSTUSR "write failure, but expect success"
echo " Done"
# cleanup
rm -f $TESTFILE
sync; sleep 3; sync;
}
# block soft limit (start timer, timer goes off, stop timer)
test_3() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
# 1 bunit on mds and 1 bunit on every ost
LIMIT=$(( $BUNIT_SZ * ($OSTCOUNT + 1) ))
GRACE=10
echo " User quota (soft limit: $LIMIT kbytes grace: $GRACE seconds)"
TESTFILE=$DIR/$tdir/$tfile-0
$LFS setstripe $TESTFILE -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
$LFS setquota -t -u --block-grace $GRACE --inode-grace $MAX_IQ_TIME $DIR
$LFS setquota -u $TSTUSR -b $LIMIT -B 0 -i 0 -I 0 $DIR
test_block_soft $TESTFILE $GRACE
resetquota -u $TSTUSR
echo " Group quota (soft limit: $LIMIT kbytes grace: $GRACE seconds)"
TESTFILE=$DIR/$tdir/$tfile-1
$LFS setstripe $TESTFILE -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
$LFS setquota -t -g --block-grace $GRACE --inode-grace $MAX_IQ_TIME $DIR
$LFS setquota -g $TSTUSR -b $LIMIT -B 0 -i 0 -I 0 $DIR
test_block_soft $TESTFILE $GRACE
resetquota -g $TSTUSR
}
run_test_with_stat 3 "Block soft limit (start timer, timer goes off, stop timer) ==="
test_file_soft() {
TESTFILE=$1
LIMIT=$2
TIMER=$(($3 * 3 / 2))
wait_delete_completed
echo " Create files to exceed soft limit"
$RUNAS createmany -m ${TESTFILE}_ $((LIMIT + 1)) || \
quota_error a $TSTUSR "create failure, but expect success"
sync; sleep 1; sync
echo " Done"
echo " Create file before timer goes off"
$RUNAS touch ${TESTFILE}_before || \
quota_error a $TSTUSR "failed create before timer expired, but expect success"
sync; sleep 1; sync
echo " Done"
echo " Sleep $TIMER seconds ..."
sleep $TIMER
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$SHOW_QUOTA_INFO_USER
$SHOW_QUOTA_INFO_GROUP
echo " Create file after timer goes off"
# the least of inode qunit is 2, so there are at most 3(qunit:2+qtune:1)
# inode quota left here
$RUNAS touch ${TESTFILE}_after ${TESTFILE}_after1 ${TESTFILE}_after2 || true
sync; sleep 1; sync
$RUNAS touch ${TESTFILE}_after3 && \
quota_error a $TSTUSR "create after timer expired, but expect EDQUOT"
sync; sleep 1; sync
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$SHOW_QUOTA_INFO_USER
$SHOW_QUOTA_INFO_GROUP
echo " Unlink files to stop timer"
find `dirname $TESTFILE` -name "`basename ${TESTFILE}`*" | xargs rm -f
echo " Done"
echo " Create file"
$RUNAS touch ${TESTFILE}_xxx || \
quota_error a $TSTUSR "touch after timer stop failure, but expect success"
sync; sleep 1; sync
echo " Done"
# cleanup
rm -f ${TESTFILE}_xxx
sync; sleep 3; sync;
}
# file soft limit (start timer, timer goes off, stop timer)
test_4a() { # was test_4
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$(($IUNIT_SZ * 10)) # 10 iunits on mds
TESTFILE=$DIR/$tdir/$tfile-0
GRACE=5
echo " User quota (soft limit: $LIMIT files grace: $GRACE seconds)"
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace $GRACE $DIR
$LFS setquota -u $TSTUSR -b 0 -B 0 -i $LIMIT -I 0 $DIR
quota_show_check f u $TSTUSR
test_file_soft $TESTFILE $LIMIT $GRACE
resetquota -u $TSTUSR
echo " Group quota (soft limit: $LIMIT files grace: $GRACE seconds)"
$LFS setquota -t -g --block-grace $MAX_DQ_TIME --inode-grace $GRACE $DIR
$LFS setquota -g $TSTUSR -b 0 -B 0 -i $LIMIT -I 0 $DIR
quota_show_check f g $TSTUSR
TESTFILE=$DIR/$tdir/$tfile-1
test_file_soft $TESTFILE $LIMIT $GRACE
resetquota -g $TSTUSR
# cleanup
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace $MAX_IQ_TIME $DIR
$LFS setquota -t -g --block-grace $MAX_DQ_TIME --inode-grace $MAX_IQ_TIME $DIR
}
run_test_with_stat 4a "File soft limit (start timer, timer goes off, stop timer) ==="
test_4b() { # was test_4a
GR_STR1="1w3d"
GR_STR2="1000s"
GR_STR3="5s"
GR_STR4="1w2d3h4m5s"
GR_STR5="5c"
GR_STR6="1111111111111111"
wait_delete_completed
# test of valid grace strings handling
echo " Valid grace strings test"
$LFS setquota -t -u --block-grace $GR_STR1 --inode-grace $GR_STR2 $DIR
$LFS quota -u -t $DIR | grep "Block grace time: $GR_STR1"
$LFS setquota -t -g --block-grace $GR_STR3 --inode-grace $GR_STR4 $DIR
$LFS quota -g -t $DIR | grep "Inode grace time: $GR_STR4"
# test of invalid grace strings handling
echo " Invalid grace strings test"
! $LFS setquota -t -u --block-grace $GR_STR4 --inode-grace $GR_STR5 $DIR
! $LFS setquota -t -g --block-grace $GR_STR4 --inode-grace $GR_STR6 $DIR
# cleanup
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace $MAX_IQ_TIME $DIR
$LFS setquota -t -g --block-grace $MAX_DQ_TIME --inode-grace $MAX_IQ_TIME $DIR
}
run_test_with_stat 4b "Grace time strings handling ==="
# chown & chgrp (chown & chgrp successfully even out of block/file quota)
test_5() {
mkdir -p $DIR/$tdir
BLIMIT=$(( $BUNIT_SZ * $((OSTCOUNT + 1)) * 10)) # 10 bunits on each server
ILIMIT=$(( $IUNIT_SZ * 10 )) # 10 iunits on mds
wait_delete_completed
echo " Set quota limit (0 $BLIMIT 0 $ILIMIT) for $TSTUSR.$TSTUSR"
$LFS setquota -u $TSTUSR -b 0 -B $BLIMIT -i 0 -I $ILIMIT $DIR
$LFS setquota -g $TSTUSR -b 0 -B $BLIMIT -i 0 -I $ILIMIT $DIR
quota_show_check a u $TSTUSR
quota_show_check a g $TSTUSR
echo " Create more than $ILIMIT files and more than $BLIMIT kbytes ..."
createmany -m $DIR/$tdir/$tfile-0_ $((ILIMIT + 1)) || \
error "touch failure, expect success"
dd if=/dev/zero of=$DIR/$tdir/$tfile-0_1 bs=$BLK_SZ count=$((BLIMIT+1)) || error "write failure, expect success"
echo " Chown files to $TSTUSR.$TSTUSR ..."
for i in `seq 0 $ILIMIT`; do
chown $TSTUSR.$TSTUSR $DIR/$tdir/$tfile-0_$i || \
quota_error a $TSTUSR "chown failure, but expect success"
done
# cleanup
unlinkmany $DIR/$tdir/$tfile-0_ $((ILIMIT + 1))
sync; sleep 3; sync;
resetquota -u $TSTUSR
resetquota -g $TSTUSR
}
run_test_with_stat 5 "Chown & chgrp successfully even out of block/file quota ==="
# block quota acquire & release
test_6() {
if [ $OSTCOUNT -lt 2 ]; then
skip_env "$OSTCOUNT < 2, too few osts"
return 0;
fi
wait_delete_completed
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$((BUNIT_SZ * (OSTCOUNT + 1) * 5)) # 5 bunits per server
FILEA="$DIR/$tdir/$tfile-0_a"
FILEB="$DIR/$tdir/$tfile-0_b"
echo " Set block limit $LIMIT kbytes to $TSTUSR.$TSTUSR"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
$LFS setquota -g $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
quota_show_check b u $TSTUSR
quota_show_check b g $TSTUSR
echo " Create filea on OST0 and fileb on OST1"
$LFS setstripe $FILEA -i 0 -c 1
$LFS setstripe $FILEB -i 1 -c 1
chown $TSTUSR.$TSTUSR $FILEA
chown $TSTUSR.$TSTUSR $FILEB
echo " Exceed quota limit ..."
RUNDD="$RUNAS dd if=/dev/zero of=$FILEA bs=$BLK_SZ"
$RUNDD count=$((LIMIT - BUNIT_SZ * OSTCOUNT)) || \
quota_error a $TSTUSR "write filea failure, but expect success"
cancel_lru_locks osc
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$RUNDD seek=$LIMIT count=$((BUNIT_SZ * OSTCOUNT)) && \
quota_error a $TSTUSR "write filea success, but expect EDQUOT"
cancel_lru_locks osc
echo " Write to OST1 return EDQUOT"
# this write maybe cache write, ignore it's failure
RUNDD="$RUNAS dd if=/dev/zero of=$FILEB bs=$BLK_SZ"
$RUNDD count=$(($BUNIT_SZ * 2)) || true
cancel_lru_locks osc
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
$RUNDD count=$((BUNIT_SZ * 2)) seek=$((BUNIT_SZ *2)) && \
quota_error a $TSTUSR "write fileb success, but expect EDQUOT"
echo " Remove filea to let OST0 release quota"
rm -f $FILEA
if at_is_enabled; then
timeout=$(at_max_get mds)
else
timeout=$(lctl get_param -n timeout)
fi
count=$((timeout / 5))
OST0_UUID=`do_facet ost1 $LCTL dl | grep -m1 obdfilter | awk '{print $((NF-1))}'`
while [ $((count--)) -gt 0 ]; do
sync && sleep 5
OST0_QUOTA_HOLD=`getquota -u $TSTUSR $OST0_UUID bhardlimit`
if [ -z $OST0_QUOTA_HOLD ]; then
error "System is error when query quota for block (U:$TSTUSR)."
else
[ $OST0_QUOTA_HOLD -gt $BUNIT_SZ ] && continue
fi
break
done
[ ! $count -gt 0 ] && error "Release quota for block timeout (U:$TSTUSR)."
$SHOW_QUOTA_USER
while [ $((count--)) -gt 0 ]; do
sync && sleep 5
OST0_QUOTA_HOLD=`getquota -g $TSTUSR $OST0_UUID bhardlimit`
if [ -z $OST0_QUOTA_HOLD ]; then
error "System is error when query quota for block (G:$TSTUSR)."
else
[ $OST0_QUOTA_HOLD -gt $BUNIT_SZ ] && continue
fi
break
done
[ ! $count -gt 0 ] && error "Release quota for block timeout (G:$TSTUSR)."
$SHOW_QUOTA_GROUP
echo " Write to OST1"
$RUNDD count=$((LIMIT - BUNIT_SZ * OSTCOUNT)) || \
quota_error a $TSTUSR "write fileb failure, expect success"
echo " Done"
# cleanup
rm -f $FILEB
sync; sleep 3; sync;
resetquota -u $TSTUSR
resetquota -g $TSTUSR
return 0
}
run_test_with_stat 6 "Block quota acquire & release ========="
# quota recovery (block quota only by now)
test_7()
{
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
wait_delete_completed
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) ))
TESTFILE="$DIR/$tdir/$tfile-0"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
$LFS setstripe $TESTFILE -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
echo " Write to OST0..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$BUNIT_SZ || \
quota_error u $TSTUSR "write failure, but expect success"
#define OBD_FAIL_OBD_DQACQ 0x604
lustre_fail mds 0x604
echo " Remove files on OST0"
rm -f $TESTFILE
lustre_fail mds 0
echo " Trigger recovery..."
OSC0_UUID="`$LCTL dl | awk '$3 ~ /osc/ { print $1 }'`"
for i in $OSC0_UUID; do
$LCTL --device $i activate || error "activate osc failed!"
done
# sleep a while to wait for recovery done
sleep 20
# check limits
PATTERN="`echo $DIR | sed 's/\//\\\\\//g'`"
TOTAL_LIMIT=`getquota -u $TSTUSR global bhardlimit`
[ $TOTAL_LIMIT -eq $LIMIT ] || error "total limits not recovery!"
echo " total limits = $TOTAL_LIMIT"
OST0_UUID=`do_facet ost1 "$LCTL dl | grep -m1 obdfilter" | awk '{print $((NF-1))}'`
[ -z "$OST0_UUID" ] && OST0_UUID=`do_facet ost1 "$LCTL dl | grep -m1 obdfilter" | awk '{print $((NF-1))}'`
OST0_LIMIT=`getquota -u $TSTUSR $OST0_UUID bhardlimit`
[ $OST0_LIMIT -eq $BUNIT_SZ ] || error "high limits not released!"
echo " limits on $OST0_UUID = $OST0_LIMIT"
# cleanup
resetquota -u $TSTUSR
}
run_test_with_stat 7 "Quota recovery (only block limit) ======"
# run dbench with quota enabled
test_8() {
mkdir -p $DIR/$tdir
BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
FILE_LIMIT=1000000
wait_delete_completed
echo " Set enough high limit for user: $TSTUSR"
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I $FILE_LIMIT $DIR
echo " Set enough high limit for group: $TSTUSR"
$LFS setquota -g $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I $FILE_LIMIT $DIR
chmod 0777 $DIR/$tdir
local duration=""
[ "$SLOW" = "no" ] && duration=" -t 120"
$RUNAS bash rundbench -D $DIR/$tdir 3 $duration || quota_error a $TSTUSR "dbench failed!"
rm -rf $DIR/$tdir
sync; sleep 3; sync;
return 0
}
run_test_with_stat 8 "Run dbench with quota enabled ==========="
# run for fixing bug10707, it needs a big room. test for 64bit
KB=1024
GB=$((KB * 1024 * 1024))
# Use this as dd bs to decrease time
# inode->i_blkbits = min(PTLRPC_MAX_BRW_BITS+1, LL_MAX_BLKSIZE_BITS);
blksize=$((1 << 21)) # 2Mb
size_file=$((GB * 9 / 2))
# this check is just for test_9
OST0_MIN=4900000 #4.67G
check_whether_skip () {
OST0_SIZE=`$LFS df $DIR | awk '/\[OST:0\]/ {print $4}'`
log "OST0_SIZE: $OST0_SIZE required: $OST0_MIN"
if [ $OST0_SIZE -lt $OST0_MIN ]; then
echo "WARN: OST0 has less than $OST0_MIN free, skip this test."
return 0
else
return 1
fi
}
test_9() {
check_whether_skip && return 0
wait_delete_completed
set_blk_tunesz 512
set_blk_unitsz 1024
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
BLK_LIMIT=$((100 * KB * KB)) # 100G
FILE_LIMIT=1000000
echo " Set block limit $BLK_LIMIT kbytes to $TSTUSR.$TSTUSR"
log " Set enough high limit(block:$BLK_LIMIT; file: $FILE_LIMIT) for user: $TSTUSR"
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I $FILE_LIMIT $DIR
log " Set enough high limit(block:$BLK_LIMIT; file: $FILE_LIMIT) for group: $TSTUSR"
$LFS setquota -g $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I $FILE_LIMIT $DIR
quota_show_check a u $TSTUSR
quota_show_check a g $TSTUSR
echo " Set stripe"
$LFS setstripe $TESTFILE -c 1 -i 0
touch $TESTFILE
chown $TSTUSR.$TSTUSR $TESTFILE
log " Write the big file of 4.5G ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$blksize count=$((size_file / blksize)) || \
quota_error a $TSTUSR "(usr) write 4.5G file failure, but expect success"
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
log " delete the big file of 4.5G..."
$RUNAS rm -f $TESTFILE
sync; sleep 3; sync;
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
RC=$?
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
return $RC
}
run_test_with_stat 9 "run for fixing bug10707(64bit) ==========="
# 2.0 version does not support 32 bit qd_count,
# test_10 "run for fixing bug10707(32bit) " is obsolete
# test a deadlock between quota and journal b=11693
test_12() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
[ "$(grep $DIR2 /proc/mounts)" ] || mount_client $DIR2 || \
{ skip_env "Need lustre mounted on $MOUNT2 " && retutn 0; }
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) * 10)) # 10 bunits each sever
TESTFILE="$DIR/$tdir/$tfile-0"
TESTFILE2="$DIR2/$tdir/$tfile-1"
wait_delete_completed
echo " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
$LFS setstripe $TESTFILE2 -i 0 -c 1
chown $TSTUSR2.$TSTUSR2 $TESTFILE2
#define OBD_FAIL_OST_HOLD_WRITE_RPC 0x21f
#define OBD_FAIL_SOME 0x10000000 /* fail N times */
lustre_fail ost $((0x0000021f | 0x10000000)) 1
echo " step1: write out of block quota ..."
$RUNAS2 dd if=/dev/zero of=$TESTFILE2 bs=$BLK_SZ count=102400 &
DDPID1=$!
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(($LIMIT*2)) &
DDPID=$!
echo " step2: testing ......"
local last_size=$(stat -c %s $TESTFILE2)
local stall_secs=0
local start_secs=$SECONDS
while [ -d /proc/${DDPID1} ]; do
local size=$(stat -c %s $TESTFILE2)
if [ $size -eq $last_size ]; then
stall_secs=$[stall_secs+1]
else
stall_secs=0
fi
if [ $stall_secs -gt 30 ]; then
lustre_fail ost 0
quota_error u $TSTUSR2 "giving up: dd stalled (i.e. made no progress) for 30 seconds!"
fi
last_size=$size
sleep 1
done
echo "(dd_pid=$DDPID1, time=$((SECONDS-start_secs)))successful"
#Recover fail_loc and dd will finish soon
lustre_fail ost 0
echo " step3: testing ......"
count=0
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
count=$[count+1]
if [ $count -gt 150 ]; then
quota_error u $TSTUSR "dd should be finished!"
fi
sleep 1
done
echo "(dd_pid=$DDPID, time=$count)successful"
rm -f $TESTFILE $TESTFILE2
sync; sleep 3; sync;
resetquota -u $TSTUSR
}
run_test_with_stat 12 "test a deadlock between quota and journal ==="
# test multiple clients write block quota b=11693
test_13() {
mkdir -p $DIR/$tdir
wait_delete_completed
# one OST * 10 + (mds + other OSTs)
LIMIT=$((BUNIT_SZ * 10 + (BUNIT_SZ * OSTCOUNT)))
TESTFILE="$DIR/$tdir/$tfile"
echo " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
$LFS setstripe $TESTFILE.2 -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE.2
echo " step1: write out of block quota ..."
# one bunit will give mds
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$[($LIMIT - $BUNIT_SZ) / 2] &
DDPID=$!
$RUNAS dd if=/dev/zero of=$TESTFILE.2 bs=$BLK_SZ count=$[($LIMIT - $BUNIT_SZ) / 2] &
DDPID1=$!
echo " step2: testing ......"
count=0
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
count=$[count+1]
if [ $count -gt 64 ]; then
quota_error u $TSTUSR "dd should be finished!"
fi
sleep 1
done
echo "(dd_pid=$DDPID, time=$count)successful"
count=0
while [ true ]; do
if ! ps -p ${DDPID1} > /dev/null 2>&1 ; then break; fi
count=$[count+1]
if [ $count -gt 64 ]; then
quota_error u $TSTUSR "dd should be finished!"
fi
sleep 1
done
echo "(dd_pid=$DDPID1, time=$count)successful"
sync; sleep 5; sync;
echo " step3: checking ......"
fz=`stat -c %s $TESTFILE`
fz2=`stat -c %s $TESTFILE.2`
$SHOW_QUOTA_USER
[ $((fz + fz2)) -lt $((BUNIT_SZ * BLK_SZ * 10)) ] && \
quota_error u $TSTUSR "files too small $fz + $fz2 < $((BUNIT_SZ * BLK_SZ * 10))"
rm -f $TESTFILE $TESTFILE.2
sync; sleep 3; sync;
resetquota -u $TSTUSR
}
run_test_with_stat 13 "test multiple clients write block quota ==="
check_if_quota_zero(){
line=`$LFS quota -v -$1 $2 $DIR | wc -l`
for i in `seq 3 $line`; do
if [ $i -eq 3 ]; then
field="3 4 7 8"
else
field="3 6"
fi
for j in $field; do
tmp=`$LFS quota -v -$1 $2 $DIR | sed -n ${i}p |
awk '{print $'"$j"'}'`
[ -n "$tmp" ] && [ $tmp -ne 0 ] && $LFS quota -v -$1 $2 $DIR && \
error "quota on $2 isn't clean"
done
done
echo "pass check_if_quota_zero"
}
test_14a() { # was test_14 b=12223 -- setting quota on root
TESTFILE="$DIR/$tdir/$tfile"
# reboot the lustre
sync; sleep 5; sync
cleanup_and_setup_lustre
quota_init
mkdir -p $DIR/$tdir
# out of root's file and block quota
$LFS setquota -u root -b 10 -B 10 -i 10 -I 10 $DIR
createmany -m ${TESTFILE} 20 || \
quota_error u root "unexpected: user(root) create files failly!"
multiop ${TESTFILE} oO_CREAT:O_WRONLY:O_DIRECT:w$((4096 * 4096))c || \
quota_error u root "unexpected: user(root) write files failly!"
chmod 666 $TESTFILE
$RUNAS multiop ${TESTFILE} oO_WRONLY:O_APPEND:O_DIRECT:w$((4096 * 4096))c && \
quota_error u root "unexpected: user(quota_usr) write a file successfully!"
# trigger the llog
chmod 777 $DIR
for i in `seq 1 10`; do $RUNAS touch ${TESTFILE}a_$i; done
for i in `seq 1 10`; do $RUNAS rm -f ${TESTFILE}a_$i; done
# do the check
dmesg | tail | grep "\-122" |grep llog_obd_origin_add && error "err -122 not found in dmesg"
resetquota -u root
#check_if_quota_zero u root
# clean
unlinkmany ${TESTFILE} 15
rm -f $TESTFILE
sync; sleep 3; sync;
}
run_test_with_stat 14a "test setting quota on root ==="
test_15(){
LIMIT=$((24 * 1024 * 1024 * 1024 * 1024)) # 24 TB
PATTERN="`echo $DIR | sed 's/\//\\\\\//g'`"
wait_delete_completed
# test for user
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
TOTAL_LIMIT=`getquota -u $TSTUSR global bhardlimit`
[ $TOTAL_LIMIT -eq $LIMIT ] || error " (user)total limits = $TOTAL_LIMIT; limit = $LIMIT, failed!"
echo " (user)total limits = $TOTAL_LIMIT; limit = $LIMIT, successful!"
resetquota -u $TSTUSR
# test for group
$LFS setquota -g $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
TOTAL_LIMIT=`getquota -g $TSTUSR global bhardlimit`
[ $TOTAL_LIMIT -eq $LIMIT ] || error " (group)total limits = $TOTAL_LIMIT; limit = $LIMIT, failed!"
echo " (group)total limits = $TOTAL_LIMIT; limit = $LIMIT, successful!"
resetquota -g $TSTUSR
$LFS quotaoff -ug $DIR
do_facet $SINGLEMDS "lctl set_param lquota.mdd_obd-${FSNAME}-MDT*.quota_type=ug" | grep "error writing" && \
error "fail to set version for $SINGLEMDS"
for j in `seq $OSTCOUNT`; do
do_facet ost$j "lctl set_param lquota.${FSNAME}-OST*.quota_type=ug" | grep "error writing" && \
error "fail to set version for ost$j"
done
echo "invalidating quota files"
$LFS quotainv -ug $DIR
$LFS quotainv -ugf $DIR
$LFS quotacheck -ug $DIR
}
run_test_with_stat 15 "set block quota more than 4T ==="
# 2.0 version does not support WITHOUT_CHANGE_QS,
# test_16 "test without adjusting qunit" is obsolete
# run for fixing bug14526, failed returned quota reqs shouldn't ruin lustre.
test_17() {
set_blk_tunesz 512
set_blk_unitsz 1024
wait_delete_completed
#define OBD_FAIL_QUOTA_RET_QDATA | OBD_FAIL_ONCE
lustre_fail ost 0x80000A02
TESTFILE="$DIR/$tdir/$tfile-a"
TESTFILE2="$DIR/$tdir/$tfile-b"
mkdir -p $DIR/$tdir
BLK_LIMIT=$((100 * 1024)) # 100M
log " Set enough high limit(block:$BLK_LIMIT) for user: $TSTUSR"
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR
log " Set enough high limit(block:$BLK_LIMIT) for group: $TSTUSR"
$LFS setquota -g $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR
quota_show_check b u $TSTUSR
quota_show_check b g $TSTUSR
touch $TESTFILE
chown $TSTUSR.$TSTUSR $TESTFILE
touch $TESTFILE2
chown $TSTUSR.$TSTUSR $TESTFILE2
log " Write the test file1 ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(( 10 * 1024 )) \
|| quota_error a $TSTUSR "write 10M file failure"
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
log " write the test file2 ..."
$RUNAS dd if=/dev/zero of=$TESTFILE2 bs=$BLK_SZ count=$(( 10 * 1024 )) \
|| quota_error a $TSTUSR "write 10M file failure"
$SHOW_QUOTA_USER
$SHOW_QUOTA_GROUP
rm -f $TESTFILE $TESTFILE2
RC=$?
sync; sleep 3; sync;
# make qd_count 64 bit
lustre_fail ost 0
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
resetquota -u $TSTUSR
resetquota -g $TSTUSR
return $RC
}
run_test_with_stat 17 "run for fixing bug14526 ==========="
# test when mds takes a long time to handle a quota req so that
# the ost has dropped it, the ost still could work well b=14840
test_18() {
LIMIT=$((100 * 1024 * 1024)) # 100G
TESTFILE="$DIR/$tdir/$tfile"
mkdir -p $DIR/$tdir
wait_delete_completed
set_blk_tunesz 512
set_blk_unitsz 1024
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $MOUNT
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
#define OBD_FAIL_MDS_BLOCK_QUOTA_REQ 0x13c
lustre_fail mds 0x13c
log " step1: write 100M block ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$((1024 * 100)) &
DDPID=$!
sleep 5
lustre_fail mds 0
echo " step2: testing ......"
count=0
if at_is_enabled; then
timeout=$(at_max_get mds)
else
timeout=$(lctl get_param -n timeout)
fi
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
count=$[count+1]
if [ $count -gt $((4 * $timeout)) ]; then
quota_error u $TSTUSR "count=$count dd should be finished!"
fi
sleep 1
done
log "(dd_pid=$DDPID, time=$count, timeout=$timeout)"
sync
cancel_lru_locks mdc
cancel_lru_locks osc
testfile_size=$(stat -c %s $TESTFILE)
[ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] && \
quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)), got ${testfile_size}. Verifying file failed!"
$SHOW_QUOTA_USER
rm -f $TESTFILE
sync
resetquota -u $TSTUSR
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
run_test_with_stat 18 "run for fixing bug14840 ==========="
# test when mds drops a quota req, the ost still could work well b=14840
test_18a() {
LIMIT=$((100 * 1024 * 1024)) # 100G
TESTFILE="$DIR/$tdir/$tfile-a"
mkdir -p $DIR/$tdir
wait_delete_completed
set_blk_tunesz 512
set_blk_unitsz 1024
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $MOUNT
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
#define OBD_FAIL_MDS_DROP_QUOTA_REQ | OBD_FAIL_ONCE 0x8000013d
lustre_fail mds 0x8000013d
log " step1: write 100M block ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$((1024 * 100)) &
DDPID=$!
echo " step2: testing ......"
count=0
if at_is_enabled; then
timeout=$(at_max_get mds)
else
timeout=$(lctl get_param -n timeout)
fi
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
count=$[count+1]
if [ $count -gt $((6 * $timeout)) ]; then
lustre_fail mds 0
quota_error u $TSTUSR "count=$count dd should be finished!"
fi
sleep 1
done
log "(dd_pid=$DDPID, time=$count, timeout=$timeout)"
lustre_fail mds 0
rm -f $TESTFILE
sync
resetquota -u $TSTUSR
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
run_test_with_stat 18a "run for fixing bug14840 ==========="
# test when mds do failover, the ost still could work well without trigger
# watchdog b=14840
test_18bc_sub() {
type=$1
LIMIT=$(((100 + $OSTCOUNT * 3) * 1024))
TESTFILE="$DIR/$tdir/$tfile"
mkdir -p $DIR/$tdir
wait_delete_completed
set_blk_tunesz 512
set_blk_unitsz 1024
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $MOUNT
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
timeout=$(sysctl -n lustre.timeout)
if [ $type = "directio" ]; then
log " write 100M block(directio) ..."
$RUNAS $DIRECTIO write $TESTFILE 0 100 $((BLK_SZ * 1024)) &
else
log " write 100M block(normal) ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$((BLK_SZ * 1024)) count=100 &
fi
DDPID=$!
do_facet $SINGLEMDS "$LCTL conf_param ${FSNAME}-MDT*.mdd.quota_type=ug"
replay_barrier $SINGLEMDS
log "failing mds for $((2 * timeout)) seconds"
fail $SINGLEMDS $((2 * timeout))
# check if quotaon successful
$LFS quota -u $TSTUSR $MOUNT 2>&1 | grep -q "quotas are not enabled"
if [ $? -eq 0 ]; then
rm -rf $TESTFILE
error "quotaon failed!"
return
fi
count=0
if at_is_enabled; then
timeout=$(at_max_get mds)
else
timeout=$(lctl get_param -n timeout)
fi
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
if [ $((++count % (2 * timeout) )) -eq 0 ]; then
log "it took $count second"
fi
sleep 1
done
log "(dd_pid=$DDPID, time=$count, timeout=$timeout)"
sync
cancel_lru_locks mdc
cancel_lru_locks osc
$SHOW_QUOTA_USER
resetquota -u $TSTUSR
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
testfile_size=$(stat -c %s $TESTFILE)
if [ $testfile_size -ne $((BLK_SZ * 1024 * 100)) ] ; then
rm -f $TESTFILE
quota_error u $TSTUSR "expect $((BLK_SZ * 1024 * 100)), got ${testfile_size}. Verifying file failed!"
fi
rm -f $TESTFILE
}
# test when mds does failover, the ost still could work well
# this test shouldn't trigger watchdog b=14840
test_18b() {
test_18bc_sub normal
test_18bc_sub directio
# check if watchdog is triggered
do_facet ost1 dmesg > $TMP/lustre-log-${TESTNAME}.log
watchdog=`awk '/test 18b/ {start = 1;}
/Service thread pid/ && /was inactive/ {
if (start) {
print;
}
}' $TMP/lustre-log-${TESTNAME}.log`
[ `echo "$watchdog" | wc -l` -ge 3 ] && error "$watchdog"
rm -f $TMP/lustre-log-${TESTNAME}.log
}
run_test_with_stat 18b "run for fixing bug14840(mds failover, no watchdog) ==========="
# test when mds does failover, the ost still could work well
# this test will prevent OST_DISCONNET from happening b=14840
test_18c() {
# define OBD_FAIL_OST_DISCONNECT_NET 0x202(disable ost_disconnect for osts)
lustre_fail ost 0x202
test_18bc_sub normal
test_18bc_sub directio
lustre_fail ost 0
}
run_test_with_stat 18c "run for fixing bug14840(mds failover, OST_DISCONNECT is disabled) ==========="
run_to_block_limit() {
local LIMIT=$((($OSTCOUNT + 1) * $BUNIT_SZ))
local TESTFILE=$1
wait_delete_completed
# set 1 Mb quota unit size
set_blk_tunesz 512
set_blk_unitsz 1024
# bind file to a single OST
$LFS setstripe -c 1 $TESTFILE
chown $TSTUSR.$TSTUSR $TESTFILE
echo " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $MOUNT
quota_show_check b u $TSTUSR
echo " Updating quota limits"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $MOUNT
quota_show_check b u $TSTUSR
RUNDD="$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ"
$RUNDD count=$BUNIT_SZ || quota_error u $TSTUSR "(usr) write failure, but expect success"
# for now page cache of TESTFILE may still be dirty,
# let's push it to the corresponding OST, this will also
# cache NOQUOTA on the client from OST's reply
cancel_lru_locks osc
$RUNDD seek=$BUNIT_SZ && quota_error u $TSTUSR "(usr) write success, should be EDQUOT"
}
test_19() {
# 1 Mb bunit per each MDS/OSS
local TESTFILE="$DIR/$tdir/$tfile"
mkdir -p $DIR/$tdir
run_to_block_limit $TESTFILE
$SHOW_QUOTA_USER
# cleanup
rm -f $TESTFILE
resetquota -u $TSTUSR
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
run_test_with_stat 19 "test if administrative limits updates do not zero operational limits (14790) ==="
test_20()
{
LSTR=(1t 2g 3m 4k) # limits strings
LVAL=($[1*1024*1024*1024] $[2*1024*1024] $[3*1024*1024] $[4*1024]) # limits values
$LFS setquota -u $TSTUSR --block-softlimit ${LSTR[0]} \
$MOUNT || error "could not set quota limits"
$LFS setquota -u $TSTUSR --block-hardlimit ${LSTR[1]} \
--inode-softlimit ${LSTR[2]} \
--inode-hardlimit ${LSTR[3]} \
$MOUNT || error "could not set quota limits"
[ "`getquota -u $TSTUSR global bsoftlimit`" = "${LVAL[0]}" ] || error "bsoftlimit was not set properly"
[ "`getquota -u $TSTUSR global bhardlimit`" = "${LVAL[1]}" ] || error "bhardlimit was not set properly"
[ "`getquota -u $TSTUSR global isoftlimit`" = "${LVAL[2]}" ] || error "isoftlimit was not set properly"
[ "`getquota -u $TSTUSR global ihardlimit`" = "${LVAL[3]}" ] || error "ihardlimit was not set properly"
resetquota -u $TSTUSR
}
run_test_with_stat 20 "test if setquota specifiers work properly (15754)"
test_21_sub() {
local testfile=$1
local blk_number=$2
local seconds=$3
time=$(($(date +%s) + seconds))
while [ $(date +%s) -lt $time ]; do
$RUNAS dd if=/dev/zero of=$testfile bs=$BLK_SZ count=$blk_number > /dev/null 2>&1
rm -f $testfile
done
}
# run for fixing bug16053, setquota shouldn't fail when writing and
# deleting are happening
test_21() {
set_blk_tunesz 512
set_blk_unitsz 1024
wait_delete_completed
TESTFILE="$DIR/$tdir/$tfile"
BLK_LIMIT=$((10 * 1024 * 1024)) # 10G
FILE_LIMIT=1000000
log " Set enough high limit(block:$BLK_LIMIT; file: $FILE_LIMIT) for user: $TSTUSR"
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I $FILE_LIMIT $MOUNT
log " Set enough high limit(block:$BLK_LIMIT; file: $FILE_LIMIT) for group: $TSTUSR"
$LFS setquota -g $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I $FILE_LIMIT $MOUNT
# repeat writing on a 1M file
test_21_sub ${TESTFILE}_1 1024 30 &
DDPID1=$!
# repeat writing on a 128M file
test_21_sub ${TESTFILE}_2 $((1024 * 128)) 30 &
DDPID2=$!
time=$(($(date +%s) + 30))
i=1
while [ $(date +%s) -lt $time ]; do
log " Set quota for $i times"
$LFS setquota -u $TSTUSR -b 0 -B $((BLK_LIMIT + 1024 * i)) -i 0 -I $((FILE_LIMIT + i)) $MOUNT
$LFS setquota -g $TSTUSR -b 0 -B $((BLK_LIMIT + 1024 * i)) -i 0 -I $((FILE_LIMIT + i)) $MOUNT
i=$((i+1))
sleep 1
done
count=0
while [ true ]; do
if ! ps -p ${DDPID1} > /dev/null 2>&1; then break; fi
count=$[count+1]
if [ $count -gt 60 ]; then
quota_error a $TSTUSR "dd should be finished!"
fi
sleep 1
done
echo "(dd_pid=$DDPID1, time=$count)successful"
count=0
while [ true ]; do
if ! ps -p ${DDPID2} > /dev/null 2>&1; then break; fi
count=$[count+1]
if [ $count -gt 60 ]; then
quota_error a $TSTUSR "dd should be finished!"
fi
sleep 1
done
echo "(dd_pid=$DDPID2, time=$count)successful"
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
resetquota -u $TSTUSR
resetquota -g $TSTUSR
return $RC
}
run_test_with_stat 21 "run for fixing bug16053 ==========="
test_22() {
quota_save_version "ug3"
stopall
mount
setupall
echo "checking parameters"
do_facet $SINGLEMDS "lctl get_param mdd.${FSNAME}-MDT*.quota_type" | grep "ug3" || error "admin failure"
do_facet ost1 "lctl get_param obdfilter.*.quota_type" | grep "ug3" || error "op failure"
quota_init
}
run_test_with_stat 22 "test if quota_type saved as permanent parameter ===="
test_23_sub() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
rm -f $TESTFILE
local bs_unit=$((1024*1024))
LIMIT=$1
wait_delete_completed
# test for user
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
sleep 3
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -c 1 -i 0
chown $TSTUSR.$TSTUSR $TESTFILE
log " Step1: trigger quota with 0_DIRECT"
log " Write half of file"
$RUNAS $DIRECTIO write $TESTFILE 0 $(($LIMIT/1024/2)) $bs_unit || \
quota_error u $TSTUSR "(1) write failure, but expect success: $LIMIT"
log " Write out of block quota ..."
$RUNAS $DIRECTIO write $TESTFILE $(($LIMIT/1024/2)) $(($LIMIT/1024/2)) $bs_unit && \
quota_error u $TSTUSR "(2) write success, but expect EDQUOT: $LIMIT"
log " Step1: done"
log " Step2: rewrite should succeed"
$RUNAS $DIRECTIO write $TESTFILE 0 1 $bs_unit || \
quota_error u $TSTUSR "(3) write failure, but expect success: $LIMIT"
log " Step2: done"
rm -f $TESTFILE
wait_delete_completed
OST0_UUID=`do_facet ost1 $LCTL dl | grep -m1 obdfilter | awk '{print $((NF-1))}'`
OST0_QUOTA_USED=`getquota -u $TSTUSR $OST0_UUID curspace`
echo $OST0_QUOTA_USED
[ $OST0_QUOTA_USED -ne 0 ] && \
($SHOW_QUOTA_USER; quota_error u $TSTUSR "quota deleted isn't released")
$SHOW_QUOTA_USER
resetquota -u $TSTUSR
}
test_23() {
local slave_cnt=$((OSTCOUNT + 1)) # 1 mds, n osts
OST0_MIN=$((6 * $slave_cnt * 1024)) # extra space for meta blocks.
check_whether_skip && return 0
log "run for $((4 * $slave_cnt))MB test file"
test_23_sub $((4 * $slave_cnt * 1024))
OST0_MIN=$((60 * $slave_cnt * 1024)) # extra space for meta blocks.
check_whether_skip && return 0
log "run for $((40 * $slave_cnt))MB test file"
test_23_sub $((40 * $slave_cnt * 1024))
}
run_test_with_stat 23 "run for fixing bug16125 ==========="
test_24() {
local TESTFILE="$DIR/$tdir/$tfile"
mkdir -p $DIR/$tdir
run_to_block_limit $TESTFILE
$SHOW_QUOTA_USER | grep '*' || error "no matching *"
# cleanup
rm -f $TESTFILE
resetquota -u $TSTUSR
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
run_test_with_stat 24 "test if lfs draws an asterix when limit is reached (16646) ==========="
show_quota() {
if [ $1 = "-u" ]; then
if [ $2 = "$TSTUSR" ]; then
$SHOW_QUOTA_USER
else
$SHOW_QUOTA_USER2
fi
else
if [ $2 = "$TSTUSR" ]; then
$SHOW_QUOTA_GROUP
else
$SHOW_QUOTA_GROUP2
fi
fi
}
test_25_sub() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
rm -f $TESTFILE
LIMIT=$(( $BUNIT_SZ * ($OSTCOUNT + 1) + 4096 ))
wait_delete_completed
# set quota for $TSTUSR
log "setquota for $TSTUSR"
$LFS setquota $1 $TSTUSR -b $LIMIT -B $LIMIT -i 10 -I 10 $DIR
sleep 3
if [ "$1" == "-u" ]; then
quota_show_check a u $TSTUSR
else
quota_show_check a g $TSTUSR
fi
# set quota for $TSTUSR2
log "setquota for $TSTUSR2"
$LFS setquota $1 $TSTUSR2 -b $LIMIT -B $LIMIT -i 10 -I 10 $DIR
sleep 3
if [ "$1" == "-u" ]; then
quota_show_check a u $TSTUSR2
else
quota_show_check a g $TSTUSR2
fi
# set stripe index to 0
log "setstripe for $DIR/$tdir to 0"
$LFS setstripe $DIR/$tdir -c 1 -i 0
MDS_UUID=`do_facet $SINGLEMDS $LCTL dl | grep -m1 " mdt " | awk '{print $((NF-1))}'`
OST0_UUID=`do_facet ost1 $LCTL dl | grep -m1 obdfilter | awk '{print $((NF-1))}'`
MDS_QUOTA_USED_OLD=`getquota $1 $TSTUSR $MDS_UUID curinodes`
OST0_QUOTA_USED_OLD=`getquota $1 $TSTUSR $OST0_UUID curspace`
MDS_QUOTA_USED2_OLD=`getquota $1 $TSTUSR2 $MDS_UUID curinodes`
OST0_QUOTA_USED2_OLD=`getquota $1 $TSTUSR2 $OST0_UUID curspace`
# TSTUSR write 4M
log "$TSTUSR write 4M to $TESTFILE"
$RUNAS dd if=/dev/zero of=$TESTFILE bs=4K count=1K || quota_error a $TSTUSR "dd failed"
sync
show_quota $1 $TSTUSR
show_quota $1 $TSTUSR2
MDS_QUOTA_USED_NEW=`getquota $1 $TSTUSR $MDS_UUID curinodes`
[ $MDS_QUOTA_USED_NEW -ne $((MDS_QUOTA_USED_OLD + 1)) ] && \
quota_error a $TSTUSR "$TSTUSR inode quota usage error: [$MDS_QUOTA_USED_OLD|$MDS_QUOTA_USED_NEW]"
OST0_QUOTA_USED_NEW=`getquota $1 $TSTUSR $OST0_UUID curspace`
OST0_QUOTA_USED_DELTA=$((OST0_QUOTA_USED_NEW - OST0_QUOTA_USED_OLD))
[ $OST0_QUOTA_USED_DELTA -lt 4096 ] && \
quota_error a $TSTUSR "$TSTUSR block quota usage error: [$OST0_QUOTA_USED_OLD|$OST0_QUOTA_USED_NEW]"
# chown/chgrp from $TSTUSR to $TSTUSR2
if [ $1 = "-u" ]; then
log "chown from $TSTUSR to $TSTUSR2"
chown $TSTUSR2 $TESTFILE || quota_error u $TSTUSR2 "chown failed"
else
log "chgrp from $TSTUSR to $TSTUSR2"
chgrp $TSTUSR2 $TESTFILE || quota_error g $TSTUSR2 "chgrp failed"
fi
sync
show_quota $1 $TSTUSR
show_quota $1 $TSTUSR2
MDS_QUOTA_USED2_NEW=`getquota $1 $TSTUSR2 $MDS_UUID curinodes`
[ $MDS_QUOTA_USED2_NEW -ne $((MDS_QUOTA_USED2_OLD + 1)) ] && \
quota_error a $TSTUSR2 "$TSTUSR2 inode quota usage transfer from $TSTUSR to $TSTUSR2 failed: [$MDS_QUOTA_USED2_OLD|$MDS_QUOTA_USED2_NEW]"
OST0_QUOTA_USED2_NEW=`getquota $1 $TSTUSR2 $OST0_UUID curspace`
# when chown, the quota on ost could be displayed out of quota temporarily. Delete the '*' in this situation. b=20433
OST0_QUOTA_USED2_NEW=${OST0_QUOTA_USED2_NEW%\*}
OST0_QUOTA_USED2_DELTA=$((OST0_QUOTA_USED2_NEW - OST0_QUOTA_USED2_OLD))
[ $OST0_QUOTA_USED2_DELTA -ne $OST0_QUOTA_USED_DELTA ] && \
quota_error a $TSTUSR2 "$TSTUSR2 block quota usage transfer from $TSTUSR to $TSTUSR2 failed: [$OST0_QUOTA_USED2_OLD|$OST0_QUOTA_USED2_NEW]"
MDS_QUOTA_USED_NEW=`getquota $1 $TSTUSR $MDS_UUID curinodes`
[ $MDS_QUOTA_USED_NEW -ne $MDS_QUOTA_USED_OLD ] && \
quota_error a $TSTUSR "$TSTUSR inode quota usage transfer from $TSTUSR to $TSTUSR2 failed: [$MDS_QUOTA_USED_OLD|$MDS_QUOTA_USED_NEW]"
OST0_QUOTA_USED_NEW=`getquota $1 $TSTUSR $OST0_UUID curspace`
[ $OST0_QUOTA_USED_NEW -ne $OST0_QUOTA_USED_OLD ] && \
quota_error a $TSTUSR "$TSTUSR block quota usage transfer from $TSTUSR to $TSTUSR2 failed: [$OST0_QUOTA_USED_OLD|$OST0_QUOTA_USED_NEW]"
rm -f $TESTFILE
wait_delete_completed
resetquota $1 $TSTUSR
resetquota $1 $TSTUSR2
}
test_25() {
log "run for chown case"
test_25_sub -u
log "run for chgrp case"
test_25_sub -g
}
run_test_with_stat 25 "test whether quota usage is transfered when chown/chgrp (18081) ==========="
test_26() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
TESTFILE="$DIR/$tdir/$tfile-0"
TESTFILE2="$DIR/$tdir/$tfile-1"
set_blk_tunesz 512
set_blk_unitsz 1024
wait_delete_completed
# every quota slave gets 20MB
b_limit=$(((OSTCOUNT + 1) * 20 * 1024))
log "limit: ${b_limit}KB"
$LFS setquota -u $TSTUSR -b 0 -B $b_limit -i 0 -I 0 $DIR
sleep 3
quota_show_check b u $TSTUSR
$LFS setstripe $TESTFILE -c 1 -i 0
$LFS setstripe $TESTFILE2 -c 1 -i 0
chown $TSTUSR.$TSTUSR $TESTFILE
chown $TSTUSR.$TSTUSR $TESTFILE2
#define OBD_FAIL_QUOTA_DELAY_REL 0xA03
lustre_fail ost 0xA03
log " Write the first file..."
$RUNAS $DIRECTIO write $TESTFILE 0 10 $((BLK_SZ * 1024)) || quota_error u $TSTUSR "write failure, but expect success"
log " Delete the first file..."
rm -f $TESTFILE
wait_delete_completed
log " Write the second file..."
$RUNAS $DIRECTIO write $TESTFILE2 0 10 $((BLK_SZ * 1024)) || quota_error u $TSTUSR "write failure, but expect success"
log " Delete the second file..."
rm -f $TESTFILE2
lustre_fail ost 0
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
resetquota -u $TSTUSR
}
run_test_with_stat 26 "test for false quota error(bz18491) ======================================"
test_27a() {
$LFS quota $TSTUSR $DIR && error "lfs succeeded with no type, but should have failed"
$LFS setquota $TSTUSR $DIR && error "lfs succeeded with no type, but should have failed"
return 0
}
run_test_with_stat 27a "lfs quota/setquota should handle wrong arguments (19612) ================="
test_27b() {
$LFS setquota -u $TSTID -b 1000 -B 1000 -i 1000 -I 1000 $DIR || \
error "lfs setquota failed with uid argument"
$LFS setquota -g $TSTID -b 1000 -B 1000 -i 1000 -I 1000 $DIR || \
error "lfs stequota failed with gid argument"
$SHOW_QUOTA_USERID || error "lfs quota failed with uid argument"
$SHOW_QUOTA_GROUPID || error "lfs quota failed with gid argument"
resetquota -u $TSTUSR
resetquota -g $TSTUSR
return 0
}
run_test 27b "lfs quota/setquota should handle user/group ID (20200) ================="
test_28() {
BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
echo "Step 1: set enough high limit for user [$TSTUSR:$BLK_LIMIT]"
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR
$SHOW_QUOTA_USER
echo "Step 2: reset system ..."
cleanup_and_setup_lustre
quota_init
echo "Step 3: change qunit for user [$TSTUSR:512:1024]"
set_blk_tunesz 512
set_blk_unitsz 1024
wait_delete_completed
#define OBD_FAIL_QUOTA_RET_QDATA | OBD_FAIL_ONCE
lustre_fail ost 0x80000A02
TESTFILE="$DIR/$tdir/$tfile"
mkdir -p $DIR/$tdir
BLK_LIMIT=$((100 * 1024)) # 100M
echo "Step 4: set enough high limit for user [$TSTUSR:$BLK_LIMIT]"
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR
$SHOW_QUOTA_USER
touch $TESTFILE
chown $TSTUSR.$TSTUSR $TESTFILE
echo "Step 5: write the test file1 [10M] ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=$(( 10 * 1024 )) \
|| quota_error a $TSTUSR "write 10M file failure"
$SHOW_QUOTA_USER
rm -f $TESTFILE
sync; sleep 3; sync;
# make qd_count 64 bit
lustre_fail ost 0
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
resetquota -u $TSTUSR
}
run_test_with_stat 28 "test for consistency for qunit when setquota (18574) ==========="
test_29()
{
local BLK_LIMIT=$((100 * 1024 * 1024)) # 100G
local timeout
local pid
if at_is_enabled; then
timeout=$(at_max_get client)
at_max_set 10 client
else
timeout=$(lctl get_param -n timeout)
lctl set_param timeout=10
fi
# actually send a RPC to make service at_current confined within at_max
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR || error "should succeed"
#define OBD_FAIL_MDS_QUOTACTL_NET 0x12e
lustre_fail mds 0x12e
$LFS setquota -u $TSTUSR -b 0 -B $BLK_LIMIT -i 0 -I 0 $DIR & pid=$!
echo "sleeping for 10 * 1.25 + 5 + 10 seconds"
sleep 28
ps -p $pid && error "lfs hadn't finished by timeout"
wait $pid && error "succeeded, but should have failed"
lustre_fail mds 0
if at_is_enabled; then
at_max_set $timeout client
else
lctl set_param timeout=$timeout
fi
resetquota -u $TSTUSR
}
run_test_with_stat 29 "unhandled quotactls must not hang lustre client (19778) ========"
test_30()
{
local output
local LIMIT=1024
local TESTFILE="$DIR/$tdir/$tfile"
local GRACE=10
set_blk_tunesz 512
set_blk_unitsz 1024
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
$LFS setquota -t -u --block-grace $GRACE --inode-grace $MAX_IQ_TIME $DIR
$LFS setquota -u $TSTUSR -b $LIMIT -B 0 -i 0 -I 0 $DIR
$RUNAS dd if=/dev/zero of=$TESTFILE bs=1024 count=$((LIMIT * 2)) || true
cancel_lru_locks osc
sleep $GRACE
$LFS setquota -u $TSTUSR -B 0 $DIR
# over-quota flag has not yet settled since we do not trigger async events
# based on grace time period expiration
$SHOW_QUOTA_USER
$RUNAS dd if=/dev/zero of=$TESTFILE conv=notrunc oflag=append bs=1048576 count=1 || true
cancel_lru_locks osc
# now over-quota flag should be settled and further writes should fail
$SHOW_QUOTA_USER
$RUNAS dd if=/dev/zero of=$TESTFILE conv=notrunc oflag=append bs=1048576 count=1 && error "grace times were reset"
rm -f $TESTFILE
resetquota -u $TSTUSR
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace $MAX_IQ_TIME $DIR
set_blk_unitsz $((128 * 1024))
set_blk_tunesz $((128 * 1024 / 2))
}
run_test_with_stat 30 "hard limit updates should not reset grace times ================"
# test duplicate quota releases b=18630
test_31() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
LIMIT=$(( $BUNIT_SZ * $(($OSTCOUNT + 1)) * 10)) # 10 bunits each sever
TESTFILE="$DIR/$tdir/$tfile-0"
TESTFILE2="$DIR/$tdir/$tfile-1"
wait_delete_completed
log " User quota (limit: $LIMIT kbytes)"
$LFS setquota -u $TSTUSR -b 0 -B $LIMIT -i 0 -I 0 $DIR
$LFS setstripe $TESTFILE -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE
$LFS setstripe $TESTFILE2 -i 0 -c 1
chown $TSTUSR.$TSTUSR $TESTFILE2
log " step1: write out of block quota ..."
$RUNAS dd if=/dev/zero of=$TESTFILE bs=$BLK_SZ count=5120
$RUNAS dd if=/dev/zero of=$TESTFILE2 bs=$BLK_SZ count=5120
#define OBD_FAIL_QUOTA_DELAY_SD 0xA04
#define OBD_FAIL_SOME 0x10000000 /* fail N times */
lustre_fail ost $((0x00000A04 | 0x10000000)) 1
log " step2: delete two files so that triggering duplicate quota release ..."
rm -f $TESTFILE $TESTFILE2
sync; sleep 5; sync # OBD_FAIL_QUOTA_DELAY_SD will delay for 5 seconds
wait_delete_completed
log " step3: verify if the ost failed"
do_facet ost1 dmesg > $TMP/lustre-log-${TESTNAME}.log
watchdog=`awk '/test 31/ {start = 1;}
/release quota error/ {
if (start) {
print;
}
}' $TMP/lustre-log-${TESTNAME}.log`
[ "$watchdog" ] && error "$watchdog"
rm -f $TMP/lustre-log-${TESTNAME}.log
lustre_fail ost 0
resetquota -u $TSTUSR
}
run_test_with_stat 31 "test duplicate quota releases ==="
# check hash_cur_bits
check_quota_hash_cur_bits() {
local bits=$1
# check quota_hash_cur_bits on all obdfilters
for num in `seq $OSTCOUNT`; do
cb=`do_facet ost$num "cat /sys/module/lquota/parameters/hash_lqs_cur_bits"`
if [ $cb -gt $bits ]; then
echo "hash_lqs_cur_bits of ost$num is too large(cur_bits=$cb)"
return 1;
fi
done
# check quota_hash_cur_bits on mds
cb=`do_facet $SINGLEMDS "cat /sys/module/lquota/parameters/hash_lqs_cur_bits"`
if [ $cb -gt $bits ]; then
echo "hash_lqs_cur_bits of mds is too large(cur_bits=$cb)"
return 1;
fi
return 0;
}
# check lqs hash
check_lqs_hash() {
# check distribution of all obdfilters
for num in `seq $OSTCOUNT`; do
do_facet ost$num "lctl get_param obdfilter.${FSNAME}-OST*.hash_stats | grep LQS_HASH" | while read line; do
rehash_count=`echo $line | awk '{print $9}'`
if [ $rehash_count -eq 0 ]; then
echo -e "ost$num:\n $line"
error "Rehearsh didn't happen"
fi
done
done
# check distribution of mds
do_facet $SINGLEMDS "lctl get_param mdt.${FSNAME}-MDT*.hash_stats | grep LQS_HASH" | while read line; do
rehash_count=`echo $line | awk '{print $9}'`
if [ $rehash_count -eq 0 ]; then
echo -e "mdt:\n $line"
error "Rehearsh didn't happen"
fi
done
}
test_32()
{
# reset system so that quota_hash_cur_bits==3
echo "Reset system ..."
local LMR_orig=$LOAD_MODULES_REMOTE
LOAD_MODULES_REMOTE=true
cleanup_and_setup_lustre
LOAD_MODULES_REMOTE=$LMR_orig
client_up
wait_mds_ost_sync
quota_init
for user in $SANITY_QUOTA_USERS; do
check_runas_id_ret $user quota_usr "runas -u $user -g quota_usr" >/dev/null 2>/dev/null || \
missing_users="$missing_users $user"
done
[ -n "$missing_users" ] && { skip_env "the following users are missing: $missing_users" ; return 0 ; }
check_quota_hash_cur_bits 3 || { skip_env "hash_lqs_cur_bits isn't set properly"; return 0;}
$LFS quotaoff -ug $DIR
$LFS quotacheck -ug $DIR
for user in $SANITY_QUOTA_USERS; do
$LFS setquota -u $user --block-hardlimit 1048576 $DIR
done
check_lqs_hash
for user in $SANITY_QUOTA_USERS; do
resetquota -u $user
done
}
run_test 32 "check lqs hash(bug 21846) =========================================="
cleanup_quota_test() {
trap 0
echo "Delete files..."
rm -rf $DIR/$tdir
}
# basic usage tracking for user & group
test_33() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
INODES=10
BLK_CNT=1024
TOTAL_BLKS=$(($INODES * $BLK_CNT))
trap cleanup_quota_test EXIT
# make sure the system is clean
USED=`getquota -u $TSTID global curspace`
[ $USED -ne 0 ] && \
error "Used space ($USED) for user $TSTID isn't 0."
USED=`getquota -g $TSTID global curspace`
[ $USED -ne 0 ] && \
error "Used space ($USED) for group $TSTID isn't 0."
echo "Write files..."
for i in `seq 0 $INODES`; do
$RUNAS dd if=/dev/zero of=$DIR/$tdir/$tfile-$i bs=$BLK_SZ \
count=$BLK_CNT oflag=sync 2>/dev/null || error "write failed"
done
echo "Verify disk usage after write"
USED=`getquota -u $TSTID global curspace`
[ $USED -lt $TOTAL_BLKS ] && \
error "Used space for user $TSTID is $USED, expected $TOTAL_BLKS"
USED=`getquota -u $TSTID global curinodes`
[ $USED -lt $INODES ] && \
error "Used inode for user $TSTID is $USED, expected $INODES"
USED=`getquota -g $TSTID global curspace`
[ $USED -lt $TOTAL_BLKS ] && \
error "Used space for group $TSTID is $USED, expected $TOTAL_BLKS"
USED=`getquota -g $TSTID global curinodes`
[ $USED -lt $INODES ] && \
error "Used inode for group $TSTID is $USED, expected $INODES"
cleanup_quota_test
echo "Verify disk usage after delete"
USED=`getquota -u $TSTID global curspace`
[ $USED -eq 0 ] || error "Used space for user $TSTID isn't 0. $USED"
USED=`getquota -u $TSTID global curinodes`
[ $USED -eq 0 ] || error "Used inodes for user $TSTID isn't 0. $USED"
USED=`getquota -g $TSTID global curspace`
[ $USED -eq 0 ] || error "Used space for group $TSTID isn't 0. $USED"
USED=`getquota -g $TSTID global curinodes`
[ $USED -eq 0 ] || error "Used inodes for group $TSTID isn't 0. $USED"
}
run_test 33 "basic usage tracking for user & group =============================="
# usage transfer test for user & group
test_34() {
BLK_CNT=1024
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
trap cleanup_quota_test EXIT
# make sure the system is clean
USED=`getquota -u $TSTID global curspace`
[ $USED -ne 0 ] && error "Used space ($USED) for user $TSTID isn't 0."
USED=`getquota -g $TSTID global curspace`
[ $USED -ne 0 ] && error "Used space ($USED) for group $TSTID isn't 0."
echo "Write file..."
dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$BLK_SZ count=$BLK_CNT \
oflag=sync 2>/dev/null || error "write failed"
echo "chown the file to user $TSTID"
chown $TSTID $DIR/$tdir/$tfile || error "chown failed"
echo "Verify disk usage for user $TSTID"
USED=`getquota -u $TSTID global curspace`
[ $USED -lt $BLK_CNT ] && \
error "Used space for user $TSTID is $USED, expected $BLK_CNT"
USED=`getquota -u $TSTID global curinodes`
[ $USED -ne 1 ] && \
error "Used inodes for user $TSTID is $USED, expected 1"
echo "chgrp the file to group $TSTID"
chgrp $TSTID $DIR/$tdir/$tfile || error "chgrp failed"
echo "Verify disk usage for group $TSTID"
USED=`getquota -g $TSTID global curspace`
[ $USED -ge $BLK_CNT ] || \
error "Used space for group $TSTID is $USED, expected $BLK_CNT"
USED=`getquota -g $TSTID global curinodes`
[ $USED -eq 1 ] || \
error "Used inodes for group $TSTID is $USED, expected 1"
cleanup_quota_test
}
run_test 34 "usage transfer for user & group ===================================="
# usage is still accessible across restart
test_35() {
mkdir -p $DIR/$tdir
chmod 0777 $DIR/$tdir
BLK_CNT=1024
trap cleanup_quota_test EXIT
echo "Write file..."
$RUNAS dd if=/dev/zero of=$DIR/$tdir/$tfile bs=$BLK_SZ \
count=$BLK_CNT oflag=sync 2>/dev/null || error "write failed"
echo "Save disk usage before restart"
ORIG_USR_SPACE=`getquota -u $TSTID global curspace`
[ $ORIG_USR_SPACE -eq 0 ] && \
error "Used space for user $TSTID is 0, expected $BLK_CNT"
ORIG_USR_INODES=`getquota -u $TSTID global curinodes`
[ $ORIG_USR_INODES -eq 0 ] && \
error "Used inodes for user $TSTID is 0, expected 1"
ORIG_GRP_SPACE=`getquota -g $TSTID global curspace`
[ $ORIG_GRP_SPACE -eq 0 ] && \
error "Used space for group $TSTID is 0, expected $BLK_CNT"
ORIG_GRP_INODES=`getquota -g $TSTID global curinodes`
[ $ORIG_GRP_INODES -eq 0 ] && \
error "Used inodes for group $TSTID is 0, expected 1"
log "Restart..."
local ORIG_REFORMAT=$REFORMAT
REFORMAT=""
cleanup_and_setup_lustre
REFORMAT=$ORIG_REFORMAT
quota_init
echo "Verify disk usage after restart"
USED=`getquota -u $TSTID global curspace`
[ $USED -eq $ORIG_USR_SPACE ] || \
error "Used space for user $TSTID changed from " \
"$ORIG_USR_SPACE to $USED"
USED=`getquota -u $TSTID global curinodes`
[ $USED -eq $ORIG_USR_INODES ] || \
error "Used inodes for user $TSTID changed from " \
"$ORIG_USR_INODES to $USED"
USED=`getquota -g $TSTID global curspace`
[ $USED -eq $ORIG_GRP_SPACE ] || \
error "Used space for group $TSTID changed from " \
"$ORIG_GRP_SPACE to $USED"
USED=`getquota -g $TSTID global curinodes`
[ $USED -eq $ORIG_GRP_INODES ] || \
error "Used inodes for group $TSTID changed from " \
"$ORIG_GRP_INODES to $USED"
cleanup_quota_test
}
run_test 35 "usage is still accessible across reboot ============================"
# turn off quota
quota_fini()
{
$LFS quotaoff $DIR
do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=-quota"
}
quota_fini
cd $ORIG_PWD
complete $(basename $0) $SECONDS
check_and_cleanup_lustre
export QUOTA_AUTO=$QUOTA_AUTO_OLD
exit_status
|
hpc/lustre
|
lustre/tests/sanity-quota.sh
|
Shell
|
gpl-2.0
| 76,131 |
#!/bin/bash
#####################################################################
#
# The intent here is to kick off a series of events based on the
# exit code provided by uTorrent.
#
# The first script removes the completed torrent from uTorrent.
#
# The second script will process the files that uTorrent just
# finished downloading. It will also download the subtitles
# then kick off the sendEmail.py script.
#
# The last three scripts provide the same function just in two
# different folders to help keep the clutter off the server.
#
#
#
#
#
#
#
#
#
#
# Author: Randy Brown
# Author Email: [email protected]
#####################################################################
if [ "$2" == "5" ]; then
cd /home/randy/scripts
echo "Executing remove.sh..." >> /home/randy/scripts/log.log
/home/randy/scripts/./remove.sh
echo "Executing filebot script..." >> /home/randy/scripts/log.log
filebot -script fn:amc --log-file "/home/randy/logs/log.log" --action move --conflict override -non-strict --def "ut_label=$1" "ut_state=$2" "ut_title=$3" "ut_kind=$4" "ut_file=$5" "ut_dir=$6" --def "seriesFormat=/home/randy/media/tv_shows/{n}/{n} - {sxe}" "movieFormat=/home/randy/media/movies/{n}/{n}" --def subtitles=en --def "exec=python sendEmail.py $2 \"{fn}\" \"{ext}\" FileBot $7"
echo $? >> /home/randy/scripts/log.log
echo "Executing filebot cleaner for /home/randy/downloads/torrentsComplete..." >> /home/randy/scripts/log.log
filebot -script fn:cleaner /home/randy/downloads/torrentsComplete --log-file "/home/randy/logs/amc.log"
echo "Executing filebot cleaner for /home/randy/media/movies..." >> /home/randy/scripts/log.log
filebot -script fn:cleaner "/home/randy/media/movies" --log-file "/home/randy/logs/amc.log"
echo "Executing filebot cleaner for /home/randy/media/tv_shows..." >> /home/randy/scripts/log.log
cd /home/randy/media/tv_shows
for d in */ ; do
filebot -script fn:cleaner "/home/randy/media/tv_shows/${d///}" --log-file "/home/randy/logs/amc.log"
done
echo "DONE" >> /home/randy/scripts/log.log
fi
|
slamdf150xc/Media_Center_Automated_Install
|
post_uTorrent.sh
|
Shell
|
gpl-2.0
| 2,053 |
#!/bin/bash
# 1H - hawk_install.sh Copyright(c) 2010 1H Ltd.
# All rights Reserved.
# [email protected] http://1h.com
# This code is subject to the 1H license. Unauthorized copying is prohibited.
VERSION='0.1.4'
# Various paths
syspath='/home/1h'
conf="$syspath/etc/hawk.conf"
db="$syspath/db/hawk.sql"
# Define the PGSQL cpustats user and generate new password for it
user="hawk_local"
dbname="hawk"
pass=$(head -n 5 /dev/urandom | md5sum | cut -d " " -f1)
#if ( ! /usr/local/1h/bin/dns_setup.sh ); then
# echo "[!] Failed to setup the 1h dns zone"
# exit 1
#fi
if ( ! /usr/local/1h/bin/add_1h_vhost.sh ); then
echo "[!] failed to add the 1h vhost to the httpd.conf"
exit 1
fi
if ( ! /usr/local/1h/bin/hawk_config.sh ); then
echo "[!] hawk_config.sh failed"
exit 1
fi
if [ ! -x /etc/init.d/postgresql ]; then
echo "Postgresql server is not installed or it's init script is missing ... can not continue"
exit 1
fi
PGDATA=/var/lib/pgsql/data
PGMAJORVERSION=$(psql -V | head -n 1 | awk '{print $3}' | sed 's/^\([0-9]*\.[0-9]*\).*$/\1/')
if [ -z "$PGMAJORVERSION" ]; then
echo "Failed to obtaion PGMAJORVERSION"
exit 1
fi
if ( ! pgrep postmaster ); then
# If postgresql is not running
if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]; then
if [ x`cat "$PGDATA/PG_VERSION"` != x"$PGMAJORVERSION" ]; then
echo "An old version of the database format was found. Trying to solve that now."
echo "You need to upgrade the data format before using PostgreSQL."
exit 1
fi
else
echo "$PGDATA is missing. Initializing it now"
if ( ! /etc/init.d/postgresql initdb ); then
echo "/etc/init.d/postgresql initdb failed"
exit 1
fi
fi
# Start postgresql please
if ( ! /etc/init.d/postgresql start ); then
echo "/etc/init.d/postgresql start failed"
exit 1
fi
fi
if ( ! chkconfig --add postgresql ); then
echo "chkconfig --add postgresql FAILED"
exit 1
fi
if ( ! chkconfig postgresql on ); then
echo "chkconfig postgresql on FAILED"
exit 1
fi
# Test the connection here please
if ( ! su - postgres -c "if ( ! psql -Upostgres template1 -c 'select 1+1;' ); then exit 1; fi" ); then
echo "Failed to test the connection to the postgresql database"
exit 1
fi
su - postgres -c "psql -Upostgres template1 -c \"drop database $dbname\""
su - postgres -c "psql -Upostgres template1 -c \"drop user $user\""
if ( ! su - postgres -c "psql -Upostgres -c \"CREATE USER $user PASSWORD '$pass'\" template1" ); then
echo "[!] Failed to create user $user"
exit 1
fi
if ( ! su - postgres -c "psql -Upostgres -c \"CREATE DATABASE $dbname OWNER $user\" template1" ); then
echo "[!] Failed to create database $dbname with owner $user"
exit 1
fi
if ( ! sed -i "/^dbpass/s/=.*/=$pass/" $conf ); then
echo "Failed to add the new host $host to $conf"
exit 1
fi
if [ ! -f /root/.pgpass ]; then
touch /root/.pgpass
chmod 600 /root/.pgpass
fi
if ( ! sed -i "/:$dbname:$user:/D" /root/.pgpass ); then
echo "[!] Failed to clean $user from /root/.pgpass"
exit 1
fi
if ( ! echo "*:*:$dbname:$user:$pass" >> /root/.pgpass ); then
echo "[!] Failed to add the new records to /root/.pgpass"
exit 1
fi
if ( ! cat $db | su - postgres -c "psql -Upostgres $dbname" ); then
echo "[!] psql -Upostgres -f $db $dbname FAILED"
exit 1
fi
if [ ! -f /var/spool/cron/root ] || ( ! grep hawk-unblock.sh /var/spool/cron/root ); then
if [ -f /var/spool/cron/root ]; then
if ( ! chattr -ia /var/spool/cron/root ); then
echo "[!] chattr -ia /var/spool/cron/root FAILED"
exit 1
fi
fi
if ( ! echo '*/5 * * * * /usr/local/1h/bin/hawk-unblock.sh >> /usr/local/1h/var/log/hawk-unblock.log 2>&1' >> /var/spool/cron/root ); then
echo "[!] Failed to add hawk-unblock.sh to the root cron"
exit 1
fi
if [ -d /usr/local/1h/lib/guardian/svcstop ]; then
touch /usr/local/1h/lib/guardian/svcstop/crond
fi
if ( ! /etc/init.d/crond restart ); then
echo "/etc/init.d/crond restart failed"
exit 1
fi
rm -f /usr/local/1h/lib/guardian/svcstop/crond
fi
if [ -d /usr/local/1h/lib/guardian/svcstop ]; then
touch /usr/local/1h/lib/guardian/svcstop/crond
fi
if [ -x /etc/init.d/crond ] && ( ! /etc/init.d/crond restart ); then
echo "/etc/init.d/crond restart failed"
exit 1
fi
rm -f /usr/local/1h/lib/guardian/svcstop/crond
if [ ! -f /var/lib/pgsql/data/pg_hba.conf ]; then
echo "/var/lib/pgsql/data/pg_hba.conf is missing"
exit 1
fi
if ( ! cat /var/lib/pgsql/data/pg_hba.conf | grep -v ^$ | grep -v '\#' | awk '{print $3}' | grep ^$user$ ); then
psql_conf="local $dbname $user md5\nhost $dbname $user 127.0.0.1 255.255.255.255 md5"
if ( ! sed -i "1i$psql_conf" /var/lib/pgsql/data/pg_hba.conf ); then
echo "[!] Failed to add the new psql config options to /var/lib/pgsql/data/pg_hba.conf"
exit 1
fi
if ( ! /etc/init.d/postgresql reload ); then
echo "[!] Failed to /etc/init.d/postgresql reload"
exit 1
fi
fi
if [ -x /usr/local/cpanel/etc/init/stopcphulkd ]; then
/usr/local/cpanel/etc/init/stopcphulkd
if ( ! rm -rf /var/cpanel/cphulk_enable ); then
echo "[!] rm -rf /var/cpanel/cphulk_enable FAILED"
exit 1
fi
fi
if ( ! /usr/local/1h/bin/lockit.sh hawk ); then
echo "[!] Failed to password protect the web folder with /usr/local/1h/bin/lockit.sh hawk"
exit 1
fi
if ( ! chkconfig --add hawk ); then
echo "chkconfig --add hawk FAILED"
exit 1
fi
if ( ! chkconfig hawk on ); then
echo "chkconfig hawk on FAILED"
exit 1
fi
if [ -d /usr/local/1h/lib/guardian/svcstop ]; then
touch /usr/local/1h/lib/guardian/svcstop/hawk
fi
if ( ! /etc/init.d/hawk restart ); then
echo "/etc/init.d/hawk restart FAILED"
exit 1
fi
rm -rf /usr/local/1h/lib/guardian/svcstop/hawk
exit 0
|
hackman/Hawk-IDS-IPS
|
bin/hawk_install.sh
|
Shell
|
gpl-2.0
| 6,061 |
#!/bin/bash
#
# Copyright (C) 2013 AlfaWolf s.r.o.
# Lumir Jasiok
# [email protected]
# http://www.alfawolf.eu
#
#
# Where are located our scripts?
HOME='/usr/local/share/graphs'
# This command will create RRD database
/usr/bin/rrdtool create $HOME/rrds/thermometer-sf-temperature.rrd --start N --step 300 \
DS:temperature:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:12 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:12:168 \
RRA:AVERAGE:0.5:12:720 \
RRA:AVERAGE:0.5:288:365
|
jas02/thermometer
|
graphs/bin/create_db.sh
|
Shell
|
gpl-2.0
| 474 |
#! /usr/bin/tcsh -f
#InitializeData.sh test 0 otest
#otest xxx Operate test 0 Read /usr/local/Software/Interface/data/initialize/StandardAlgorithmsClass.inp\
# /usr/local/Software/Interface/data/initialize/StandardAlgorithms.inp 0
#otest xxx Operate test 1 Read /usr/local/Software/Interface/data/initialize/StandardLogicClass.inp\
# /usr/local/Software/Interface/data/initialize/StandardLogic.inp 0
#otest xxx Operate test 2 Read /usr/local/Software/Interface/data/initialize/StandardExpressionsClass.inp\
# /usr/local/Software/Interface/data/initialize/StandardExpressions.inp 0
#otest xxx Operate test 3 Flame SpeciesSensitivity.txt 0.000001
#otest xxx Experiment test 4 Print Attribute MatrixObject
#otest xxx Operate test 4 MakeInstanceFromMatrix MatrixObject
cat <<EOF > Start.inp
Read /usr/local/Software/Interface/data/initialize/StandardAlgorithmsClass.inp /usr/local/Software/Interface/data/initialize/StandardAlgorithms.inp 0
Read /usr/local/Software/Interface/data/initialize/StandardLogicClass.inp /usr/local/Software/Interface/data/initialize/StandardLogic.inp 0
Read /usr/local/Software/Interface/data/initialize/StandardExpressionsClass.inp /usr/local/Software/Interface/data/initialize/StandardExpressions.inp 0
Flame SpeciesSensitivity.txt 0.000001
Print Attribute MatrixObject
MakeInstanceFromMatrix MatrixObject
END
EOF
otest xxx Operate test 0 < Start.inp
#otest xxx Experiment test 2 Write Instance All \
#CO2 H O2 CH3 OH H2 CH4 H2O CO\
#CO2 3-CH2 C2H3 O C2H2 HO2 C3H6 \
#C2H4 CH CHCO C3H7 C2H6 C2H C2H5 \
#CH2O CHO C3H5 C3H4 C3H3 H2O2 IPRO C3H8
#otest xxx Operate test 5 Read DistInfoClass.inp DistInfo.inp 0
#otest xxx Change test 6 RunAlgorithm DistributionAlg 0
#otest xxx Experiment test 3 DistributionReport report Distributions
#otest xxx Experiment test 3 MakeCriticalPoints critpoints Distributions
#otest xxx Operate test 3 Read critClass.inp critpointsSetUp.dat 0
#otest xxx Change test 4 RunGoal PartitionsFromCriticalPoints 0
#otest xxx Operate test 4 Read CobwebSetupClass.inp CobwebSetup.inp 0
#otest xxx Change test 5 RunAlgorithm InstanceSetUpAlg 0
#otest xxx Change test 5 RunAlgorithm CobwebClusterAlg 1
|
blurock/REACTION
|
Flame/examples/Flame/Test.sh
|
Shell
|
gpl-3.0
| 2,348 |
mvn cobertura:cobertura -Dcobertura.report.format=xml -DwithHistory org.pitest:pitest-maven:mutationCoverage sonar:sonar -Dsonar.pitest.mode=reuseReport -Dsonar.scm.provider=git
|
psachdev6375/devcapsule
|
services/publish-stats.sh
|
Shell
|
gpl-3.0
| 179 |
#!/bin/sh
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# GNUHAWK is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see http://www.gnu.org/licenses/.
#
if [ "$1" = "rpm" ]; then
# A very simplistic RPM build scenario
if [ -e vector_source_i.spec ]; then
mydir=`dirname $0`
tmpdir=`mktemp -d`
cp -r ${mydir} ${tmpdir}/vector_source_i-1.0.0
tar czf ${tmpdir}/vector_source_i-1.0.0.tar.gz --exclude=".svn" -C ${tmpdir} vector_source_i-1.0.0
rpmbuild -ta ${tmpdir}/vector_source_i-1.0.0.tar.gz
rm -rf $tmpdir
else
echo "Missing RPM spec file in" `pwd`
exit 1
fi
else
for impl in cpp ; do
cd $impl
if [ -e build.sh ]; then
./build.sh $*
elif [ -e reconf ]; then
./reconf && ./configure && make
else
echo "No build.sh found for $impl"
fi
cd -
done
fi
|
RedhawkSDR/integration-gnuhawk
|
components/vector_source_i/build.sh
|
Shell
|
gpl-3.0
| 1,566 |
#!/bin/bash
pushd "$(dirname $0)" > /dev/null
DIR="$(pwd)"
popd > /dev/null
ln -s "$DIR/pre-commit.sh" "$DIR/../.git/hooks/pre-commit"
|
CobaltCake/ground-up
|
hooks/setup.sh
|
Shell
|
gpl-3.0
| 136 |
#!/bin/bash
set -e
BIN=$(readlink -f $(dirname $0)/../..)
function die()
{
echo "$1"
exit 1
}
function check_variable()
{
eval val='$'$1
[ "$val" != "" ] || die "$1 not defined"
}
check_variable VERSION
echo Packing binaries
echo $BIN
cd $BIN
RESULT_DIR=$BIN/dist
#mkdir -p $RESULT_DIR
#cp -r linux-bin/ $RESULT_DIR
#cp -r windows-bin/ $RESULT_DIR
tar --transform "s/.*\/dist//" -czf RedXpert-$VERSION.tar.gz $RESULT_DIR
cd $RESULT_DIR
zip -rq ../RedXpert-$VERSION.zip ./
cd ..
mv RedXpert-$VERSION.tar.gz $RESULT_DIR
mv RedXpert-$VERSION.zip $RESULT_DIR
|
redsoftbiz/executequery
|
ci/package-bin.sh
|
Shell
|
gpl-3.0
| 567 |
#!/bin/bash
[ -n "$DEBUG" ] && set -o xtrace
set -o nounset
set -o errexit
shopt -s nullglob
cd $(dirname "$0")
if [ -z "${1}" ]; then
echo "Usage: ${0} <instance_path>"
exit 1
fi
target=${1}
if [ -d ${target} ]; then
echo "\"${target}\" already exists, aborting..."
exit 1
fi
cp -r skeleton "${target}"
"${target}"/setup.sh
echo ${target}
|
andybondar/cf-installer
|
warden/warden/root/insecure/create.sh
|
Shell
|
gpl-3.0
| 354 |
R --slave <<EOF
source("http://bioconductor.org/biocLite.R")
biocLite("mzR")
biocLite("xcms")
biocLite("Rgraphviz")
biocLite("brew")
biocLite("RCurl")
biocLite("grid")
biocLite("bitops")
biocLite("graph")
EOF
|
NetherlandsMetabolomicsCentre/metitree
|
R/install.sh
|
Shell
|
gpl-3.0
| 209 |
#!/bin/bash
#1i
. /opt/ownsec/ITSEC-Install-Scripts-ORIG/001.functions/all-scripts.sh
GITREPO=https://github.com/v3n0m-scanner/V3n0M-Scanner.git
BRANCH=master
GITREPOROOT=/opt/ITSEC/2.Vulnerability-Scanner/v3n0m-scanner/v3n0m-scanner/V3n0M-Scanner
BINDIRLCL=/opt/ITSEC/2.Vulnerability-Scanner/v3n0m-scanner/v3n0m-scanner/V3n0M-Scanner/src
GITCLONEDIR=/opt/ITSEC/2.Vulnerability-Scanner/v3n0m-scanner/v3n0m-scanner
EXECUTEABLE1=v3n0m.sh
EXECUTEABLE2=v3n0m
#ph1b
DSKTPFLS=/opt/ownsec/ITSEC-Install-Scripts-ORIG/2.Vulnerability-Scanner/v3n0m-scanner
DSKTPFLSDEST=/home/$USER/.local/share/applications/2.Vulnerability-Scanner/v3n0m-scanner
DSKTPFL=v3n0m.desktop
APTLSTDIR=/opt/ownsec/ITSEC-Install-Scripts-ORIG/2.Vulnerability-Scanner/v3n0m-scanner
#ph1a
echo "${bold}
__ _______ _ _ ___ __ __
\ \ / /___ /| \ | |/ _ \| \/ |
\ \ / / |_ \| \| | | | | |\/| |
\ V / ___) | |\ | |_| | | | |
\_/ |____/|_| \_|\___/|_| |_|
INSTALL
${normal}"
#plh11
GITCLONEFUNC
### DEPS:
# no deps noted, feel free to add ...
### DEPS END
GITSBMDLINIT
# sudo python3 setup.py install #doesent work as it seems, lets link that up ..
cd $BINDIRLCL
echo '#!/bin/bash
cd /opt/ITSEC/2.Vulnerability-Scanner/v3n0m-scanner/v3n0m-scanner/V3n0M-Scanner/src
python3 v3n0m.py "$@"' > $EXECUTEABLE1
chmod +x $EXECUTEABLE1
sudo ln -s $BINDIRLCL/$EXECUTEABLE1 $BINDIR/$EXECUTEABLE2
#333d
CPDESKTFL
|
alphaaurigae/ITSEC-Install-Scripts
|
ITSEC-Install-Scripts-ORIG/2.Vulnerability-Scanner/v3n0m-scanner/v3n0m-scanner-install.sh
|
Shell
|
gpl-3.0
| 1,408 |
#!/bin/sh
printid() {
cat <<"ID"
V-51369
ID
}
printseverity() {
cat <<"SEVERITY"
low
SEVERITY
}
printfix() {
cat <<"FIX"
The SELinux "targeted" policy is appropriate for general-purpose desktops and servers, as well as systems in many other roles. To configure the system to use this policy, add or correct the following line in "/etc/selinux/config":SELINUXTYPE=targetedOther policies, such as "mls", provide additional security labeling and greater confinement but are not compatible with many general-purpose use cases.
FIX
}
printtitle() {
cat <<"TITLE"
The system must use a Linux Security Module configured to limit the privileges of system services.
TITLE
}
printdescription() {
cat <<"DESCRIPTION"
Setting the SELinux policy to "targeted" or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services.
DESCRIPTION
}
|
Taywee/dod-stig-scripts
|
linux/V-51369/vars.sh
|
Shell
|
gpl-3.0
| 944 |
#!/bin/bash
# Author: pblaas ([email protected])
# This script is used to generate a kubernetes user certificate files for RBAC enabled cluster.
if [ ! -f set/ca.pem ]; then
echo set/ca.pem not found.
echo Create a cluster certificate set first.
exit 1
fi
if [ ! $1 ]; then
echo Use following syntax:
echo Syntax: $0 [USERNAME] [DEFAULT-NAMESPACE]
exit 1
fi
#creating new user certificate.
if [ ! -f config.env ]; then
echo config.env not found.
echo cp config.env.sample to config.env and run the create_cloudinit.sh script.
exit 1
fi
. config.env
#create demouser certs
openssl genrsa -out set/$1-key.pem 2048
openssl req -new -key set/$1-key.pem -out set/$1.csr -subj "/CN=$1"
openssl x509 -req -in set/$1.csr -CA set/ca.pem -CAkey set/ca-key.pem -CAcreateserial -out set/$1.pem -days 365
echo "Configure the user with the following settings:"
echo ""
echo "kubectl config set-cluster $MASTER_HOST_IP-cluster --server=https://$MASTER_HOST_IP --certificate-authority=./set/ca.pem"
echo "kubectl config set-credentials $MASTER_HOST_IP-$1 --certificate-authority=./set/ca.pem --client-key=./set/$1-key.pem --client-certificate=./set/$1.pem"
echo "kubectl config set-context $MASTER_HOST_IP-$1 --cluster=$MASTER_HOST_IP-cluster --user=$MASTER_HOST_IP-$1 --namespace=$2"
echo "kubectl config use-context $MASTER_HOST_IP-$1"
echo ""
|
pblaas/cloudinit_generator
|
create_user.sh
|
Shell
|
gpl-3.0
| 1,365 |
#/bin/bash
#TODO RELATIVE_PATH_TO_ROOT needs to be computed automagically or it will not work on all path depths
RELATIVE_PATH_TO_ROOT="../.."
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$RELATIVE_PATH_TO_ROOT/src:$RELATIVE_PATH_TO_ROOT/inetmanet/src"
nedPath="$RELATIVE_PATH_TO_ROOT/inetmanet/src:$RELATIVE_PATH_TO_ROOT/inetmanet/examples:.:$RELATIVE_PATH_TO_ROOT/omnetpp"
cd $DIR
# Starts a single OMNeT++ simulation run on the Cmdenv
# $1: run number or "*" for all
function runSimulation() {
if [ "$1" = "*" ]; then
logName=$experimentName-Log.txt
echo "Running simulation. Log is saved to $DIR/results/$logName"
$RELATIVE_PATH_TO_ROOT/omnetpp/ara-sim -u Cmdenv -c $experimentName -n "$nedPath" omnetpp.ini > $DIR/results/$logName
else
logName=$experimentName-$1-Log.txt
echo "Run $(($1+1))/$numberOfRuns: Log is saved to $DIR/results/$logName"
$RELATIVE_PATH_TO_ROOT/omnetpp/ara-sim -r "$1" -u Cmdenv -c $experimentName -n "$nedPath" omnetpp.ini > $DIR/results/$logName
fi
}
if [ $# -eq 0 ]; then
# just run the simulation with the GUI
$RELATIVE_PATH_TO_ROOT/omnetpp/ara-sim -r 0 -n "$nedPath" omnetpp.ini
else
if [ $1 == "--debug" ]; then
# run the simulation with the GUI but use nemiver as debugger
nemiver $RELATIVE_PATH_TO_ROOT/omnetpp/ara-sim -r 0 -n "$nedPath" omnetpp.ini
elif [ $1 == "--help" ]; then
scriptName=`basename $0`
echo "libARA simulation run script by Friedrich Große"
echo "Usage: $scriptName [<experiment_name> [<number_of_runs>] ] [--debug] | --help]"
echo "Description:"
echo " - You can run the GUI if no parameters are supplied."
echo " - If you anter an experiment name as first parameter the simulation is run on the command line"
echo " - You can additionally define the number of repetitions for more statistically meaningful results"
echo " - If you want to run the debugger (nemiver) on the given experiment you can use --debug as second parameter"
exit 1
fi
# normally the first parameter contains the experiment (scenario) name to run on Cmdenv
experimentName=$1
echo "Running simulation [$experimentName]"
# prepare the results directory
mkdir --parents "./results"
echo "Removing all files that match './results/$experimentName-*'"
rm -f "$DIR/results/$experimentName-"*
if [ $# -ge 2 ]; then
if [ $2 == "--debug" ]; then
echo "Running nemiver debug..."
nemiver $RELATIVE_PATH_TO_ROOT/omnetpp/ara-sim -r 0 -u Cmdenv -c $experimentName -n "$nedPath" omnetpp.ini
else
numberOfRuns=$2
for ((i=0; $i<$numberOfRuns; i++)); do
runSimulation $i
done
echo ""
echo "All simulation runs finished"
fi
else
runSimulation "*"
fi
fi
|
des-testbed/libara
|
simulations/run.sh
|
Shell
|
gpl-3.0
| 2,747 |
#!/bin/bash
# SSAFD verification test V (van der Veen) regression test
PISM_PATH=$1
MPIEXEC=$2
MPIEXEC_COMMAND="$MPIEXEC -n 1"
PISM_SOURCE_DIR=$3
EXT=""
if [ $# -ge 4 ] && [ "$4" == "-python" ]
then
PYTHONEXEC=$5
MPIEXEC_COMMAND="$MPIEXEC_COMMAND $PYTHONEXEC"
PYTHONPATH=${PISM_PATH}/site-packages:${PYTHONPATH}
PISM_PATH=${PISM_SOURCE_DIR}/examples/python/ssa_tests
EXT=".py"
fi
# List of files to remove when done:
files="foo-V.nc foo-V.nc~ test-V-out.txt"
rm -f $files
set -e
set -x
OPTS="-verbose 1 -o foo-V.nc -My 3 -ssafd_ksp_type richardson -ssafd_pc_type lu"
# do stuff
$MPIEXEC_COMMAND $PISM_PATH/ssa_test_cfbc${EXT} -Mx 201 $OPTS > test-V-out.txt
$MPIEXEC_COMMAND $PISM_PATH/ssa_test_cfbc${EXT} -Mx 401 $OPTS >> test-V-out.txt
set +e
# Check results:
diff test-V-out.txt - <<END-OF-OUTPUT
NUMERICAL ERRORS in velocity relative to exact solution:
velocity : maxvector prcntavvec maxu maxv avu avv
1.0998 0.06498 1.0998 0.0000 0.6331 0.0000
NUM ERRORS DONE
NUMERICAL ERRORS in velocity relative to exact solution:
velocity : maxvector prcntavvec maxu maxv avu avv
0.5112 0.02765 0.5112 0.0000 0.2697 0.0000
NUM ERRORS DONE
END-OF-OUTPUT
if [ $? != 0 ];
then
exit 1
fi
rm -f $files; exit 0
|
talbrecht/pism_pik
|
test/regression/ssa/ssa_test_cfbc_fd.sh
|
Shell
|
gpl-3.0
| 1,341 |
#!/usr/bin/env bash
#
# Run the top level aggregation of language features.
#
# Input
# A file take place on HDFS /join directory (such as result*-language.csv)
# This file should be the output of record-level language measurement
# Output
# languages.csv
INPUT=$1
if [[ ("$#" -ne 1) || ("$INPUT" == "") ]]; then
echo "You should add an input file!"
exit 1
fi
OUTPUTFILE=saturation.csv
hdfs dfs -rm -r /join/$OUTPUTFILE
spark-submit \
--class Saturation \
--master local[6] \
target/scala-2.11/europeana-qa_2.11-1.0.jar \
hdfs://localhost:54310/join/ $INPUT $OUTPUTFILE
echo Retrieve $OUTPUTFILE
hdfs dfs -getmerge /join/$OUTPUTFILE $OUTPUTFILE
rm .*.crc
echo DONE
|
pkiraly/europeana-qa-spark
|
scala/saturation.sh
|
Shell
|
gpl-3.0
| 695 |
#!/bin/sh
DOCKER_REPO=barakci
DOCKER_NAME=$DOCKER_USERNAME/$DOCKER_REPO
if [ "$TRAVIS_BRANCH" = "master" ]; then
TAG="latest"
else
TAG="$TRAVIS_BRANCH"
fi
CONTAINER_ID=$DOCKER_NAME:$TAG
docker build -t $CONTAINER_ID .
docker run -d -p 8080:8080 $CONTAINER_ID
docker ps
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push $CONTAINER_ID;
|
barrackHa/node_docker_ci
|
.travis/dockerizer.sh
|
Shell
|
gpl-3.0
| 368 |
#!/bin/bash
# Script for style checking
#
# This file is part of PhrasIt.
#
# PhrasIt is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PhrasIt is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PhrasIt. If not, see <http://www.gnu.org/licenses/>.
cpplint() {
python2 ./tools/cpplint.py "$@"
}
cpplint --extensions=hpp,cpp \
--filter=-runtime/references,-build/include_order,-runtime/indentation_namespace,-runtime/int,-readability/namespace,-runtime/explicit,-build/namespaces,-whitespace/line_length,-readability/streams "$@"
|
stg7/phrasit
|
test_convention.sh
|
Shell
|
gpl-3.0
| 1,009 |
#!/bin/bash
date=$(date -d "3 minutes ago" +"%s")
tail -100 /var/log/nginx/access.log | (
while read line; do
[ `date -d"$(echo $line | cut -d' ' -f4 | sed -e 's/.*\[//;s/\// /g;s/:/ /;')" +"%s"` -ge $date ] && echo $line
done) | grep update.html
|
ablava/AWS-S3-image-proxy
|
check_update_requests.sh
|
Shell
|
gpl-3.0
| 249 |
#!/bin/bash
. /start-utils
if [[ $( ps -a -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; then
# save world
rcon-cli save-all >/dev/null
# wait until mc-monitor is no longer connected to the server
while :
do
if [[ -z "$(netstat -nt | grep "127.0.0.1:$SERVER_PORT" | grep 'ESTABLISHED')" ]]; then
break
fi
sleep 0.1
done
# finally pause the process
logAutopauseAction "Pausing Java process"
pkill -STOP java
fi
|
MediaKraken/MediaKraken_Deployment
|
docker/game_server/ComposeMediaKrakenMinecraft/files/autopause/pause.sh
|
Shell
|
gpl-3.0
| 466 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.