def setupCPUs(): cpus = detectCPUs() cpulist = [] #print "[+] This machine has %d CPUs" %cpus for i in range(0,cpus): cpufreq = pycpufreq.pycpufreq(cpu = i) cpufreq.status() cpulist.append(cpufreq) return cpulist
def setupCPUs(): cpus = detectCPUs() cpulist = [] #print "[+] This machine has %d CPUs" %cpus for i in range(0, cpus): cpufreq = pycpufreq.pycpufreq(cpu=i) cpufreq.status() cpulist.append(cpufreq) return cpulist
def setCPUspeed(options): for i in range(0, 8): cpufreq = pycpufreq.pycpufreq(cpu=i) cpufreq.status() #print cpufreq.dump() if not amIRoot(): print "[-] You need to be root to change frequency!" sys.exit(1) if options.cpuspeed == "max": print "[+] Setting CPU:%d maximum CPU speed:%s" %(i,cpufreq.speed_max) cpufreq.setspeed(cpuspeedy.SPEED_MAX(cpufreq.speed_max)) elif options.cpuspeed == "min": print "[+] Setting CPU:%d minimum CPU speed:%s" %(i,cpufreq.speed_min) cpufreq.setspeed(cpuspeedy.SPEED_MIN(cpufreq.speed_min))
def setCPUspeed(options): for i in range(0, 8): cpufreq = pycpufreq.pycpufreq(cpu=i) cpufreq.status() #print cpufreq.dump() if not amIRoot(): print "[-] You need to be root to change frequency!" sys.exit(1) if options.cpuspeed == "max": print "[+] Setting CPU:%d maximum CPU speed:%s" % ( i, cpufreq.speed_max) cpufreq.setspeed(cpuspeedy.SPEED_MAX(cpufreq.speed_max)) elif options.cpuspeed == "min": print "[+] Setting CPU:%d minimum CPU speed:%s" % ( i, cpufreq.speed_min) cpufreq.setspeed(cpuspeedy.SPEED_MIN(cpufreq.speed_min))