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
-- https://psutil.readthedocs.io/en/latest/#psutil.Process.memory_full_info | |
-- Linux: 0=rss, 1=vms, 2=shared, 3=text, 4=lib, 5=data, 6=dirty, 7=uss, 8=pss, 9=swap | |
CREATE OR REPLACE FUNCTION get_memory_info(pid INTEGER DEFAULT NULL, memtype INTEGER DEFAULT 0) | |
RETURNS BIGINT | |
AS | |
$$ | |
import psutil | |
p = psutil.Process(pid) | |
return p.memory_full_info()[memtype] | |
$$ |
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
#!/usr/bin/env python | |
# | |
# automated ESP8266 programming station | |
# monitors for inserted serial devices and calls esptool to flash them | |
# written to mass flash entire batches of ESP8266 devices quickly | |
# $ pip install esptool pyudev | |
# | |
# 2016.06.16 darell tan | |
# |