Tag Archive - windows

python psutil windows process list

Ever wondered how to check what your firefox is doing in the background, using windows processexplorer and a series of these commands on windows will help you trace the process

1
2
3
4
C:'WINDOWS>netstat -an |find /i "listening"
C:'WINDOWS>netstat -an |find /i "established"
C:'WINDOWS>netstat -no
C:'WINDOWS>pulist |find /i "1536"

But a similar but much detailed output can be achieved using the python psutils module

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import psutil

def process():
    plist = psutil.get_process_list()
    plist = sorted(plist, key=lambda i: i.name)
    for i in plist:
        if "firefox.exe" in i.name:
            #print i.get_memory_info()
            print "process id ", i.pid
            rss,vms = i.get_memory_info()
            print "memory used ", str(round(i.get_memory_percent(),2))+ "%"
            print "memory used in ram = "+ str(round((float(rss/1024)/1024), 2)) +" MB"
            print "swap memory usage = "+ str(round((float(vms/1024)/1024), 2)) +" MB"
            print "cpu utilization "+ str(i.get_cpu_percent()) +"%"
            user,system = i.get_cpu_times()
            print "cpu time spent outside the kernel ",user
            print "cpu time spent inside the kernel ",system
            #print i.get_connections()
            print "network connections....."
            for g in i.get_connections():
                print "local address "+ str(g[3]) + "-->" + str(g[4]) + " status "+ str(g[5])
            #print i.get_threads()


def main():
    process()


main()

Continue Reading…

 

» How to Restrict Certain Users from Using Programs on Your PC (Registry Tweak Instructions)

For registry fix “Restrict Certain Users from Using Programs on Your PC,” you’ll need to:

Backup your system and its important files before editing your registry.

Now, open your registry. You can open your registry by using the Registry Editor (REGEDIT.exe), which is a program automatically included with most Windows operating systems. The Registry Editor lets you view, edit, and search data within the your system’s registry. You can launch your Registry Editor many ways, and the easiest way to is to click the “Start” button, select “Run,” and type “regedit” inthe “Open” box (click here for a sample image of Registry Editor and instructions on how to use Registry Editor).

Continue Reading…

 
Page 1 of 11
Theme Tweaker by Unreal