Created
March 12, 2013 11:24
-
-
Save rjohnsondev/5142166 to your computer and use it in GitHub Desktop.
Snippet I found online to quickly rename processes for easy tracking in top.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def set_proc_name(newname): | |
from ctypes import cdll, byref, create_string_buffer | |
libc = cdll.LoadLibrary('libc.so.6') | |
buff = create_string_buffer(len(newname)+1) | |
buff.value = newname | |
libc.prctl(15, byref(buff), 0, 0, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment