Archive - windows RSS Feed

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…

 

10 free win32 ssh terminal clients

This is a list of ten ssh terminal clients found on the web.

  1. Putty A free telnet and SSH Client for Windows and Unix platforms
  2. Kitty Continue Reading…
 

How to find the SiteID in IIS5 and IIS6

In IIS 5 or 6 you can find the site ID by selecting properties of the website -> properties for logging. find the log file name at the bottom, it would be something like
Continue Reading…

 
Page 1 of 11
Theme Tweaker by Unreal