!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/src/linux-oracle-5.13-headers-5.13.0-1018/tools/testing/selftests/cpufreq/   drwxr-xr-x
Free 83.23 GB of 96.73 GB (86.05%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     governor.sh (2.72 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Test governors

# protect against multiple inclusion
if [ $FILE_GOVERNOR ]; then
	return 0
else
	FILE_GOVERNOR=DONE
fi

source cpu.sh
source cpufreq.sh

CUR_GOV=
CUR_FREQ=

# Find governor's directory path
# $1: policy, $2: governor
find_gov_directory()
{
	if [ -d $CPUFREQROOT/$2 ]; then
		printf "$CPUFREQROOT/$2\n"
	elif [ -d $CPUFREQROOT/$1/$2 ]; then
		printf "$CPUFREQROOT/$1/$2\n"
	else
		printf "INVALID\n"
	fi
}

# $1: policy
find_current_governor()
{
	cat $CPUFREQROOT/$1/scaling_governor
}

# $1: policy
backup_governor()
{
	CUR_GOV=$(find_current_governor $1)

	printf "Governor backup done for $1: $CUR_GOV\n"

	if [ $CUR_GOV == "userspace" ]; then
		CUR_FREQ=$(find_current_freq $1)
		printf "Governor frequency backup done for $1: $CUR_FREQ\n"
	fi

	printf "\n"
}

# $1: policy
restore_governor()
{
	__switch_governor $1 $CUR_GOV

	printf "Governor restored for $1 to $CUR_GOV\n"

	if [ $CUR_GOV == "userspace" ]; then
		set_cpu_frequency $1 $CUR_FREQ
		printf "Governor frequency restored for $1: $CUR_FREQ\n"
	fi

	printf "\n"
}

# param:
# $1: policy, $2: governor
__switch_governor()
{
	echo $2 > $CPUFREQROOT/$1/scaling_governor
}

# param:
# $1: cpu, $2: governor
__switch_governor_for_cpu()
{
	echo $2 > $CPUROOT/$1/cpufreq/scaling_governor
}

# SWITCH GOVERNORS

# $1: cpu, $2: governor
switch_governor()
{
	local filepath=$CPUFREQROOT/$1/scaling_available_governors

	# check if governor is available
	local found=$(cat $filepath | grep $2 | wc -l)
	if [ $found = 0 ]; then
		echo 1;
		return
	fi

	__switch_governor $1 $2
	echo 0;
}

# $1: policy, $2: governor
switch_show_governor()
{
	cur_gov=find_current_governor
	if [ $cur_gov == "userspace" ]; then
		cur_freq=find_current_freq
	fi

	# switch governor
	__switch_governor $1 $2

	printf "\nSwitched governor for $1 to $2\n\n"

	if [ $2 == "userspace" -o $2 == "powersave" -o $2 == "performance" ]; then
		printf "No files to read for $2 governor\n\n"
		return
	fi

	# show governor files
	local govpath=$(find_gov_directory $1 $2)
	read_cpufreq_files_in_dir $govpath
}

# $1: function to be called, $2: policy
call_for_each_governor()
{
	local filepath=$CPUFREQROOT/$2/scaling_available_governors

	# Exit if cpu isn't managed by cpufreq core
	if [ ! -f $filepath ]; then
		return;
	fi

	backup_governor $2

	local governors=$(cat $filepath)
	printf "Available governors for $2: $governors\n"

	for governor in $governors; do
		$1 $2 $governor
	done

	restore_governor $2
}

# $1: loop count
shuffle_governors_for_all_cpus()
{
	printf "** Test: Running ${FUNCNAME[0]} for $1 loops **\n\n"

	for i in `seq 1 $1`; do
		for_each_policy call_for_each_governor switch_show_governor
	done
	printf "%s\n\n" "------------------------------------------------"
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0043 ]--