activate RTTI in c++

Are you using g++ or some other compiler? In g++ RTTI is enabled by default IIRC, and you can disable it with -fno-rtti. To test whether it is active or not use dynamic_cast or typeid UPDATE I believe that HPUX’s aCC/aC++ also has RTTI on by default, and I am unaware of a way to … Read more

Cross-platform way to get PIDs by process name in python

You can use psutil (https://github.com/giampaolo/psutil), which works on Windows and UNIX: import psutil PROCNAME = “python.exe” for proc in psutil.process_iter(): if proc.name() == PROCNAME: print(proc) On my machine it prints: <psutil.Process(pid=3881, name=”python.exe”) at 140192133873040> EDIT 2017-04-27 – here’s a more advanced utility function which checks the name against processes’ name(), cmdline() and exe(): import os … Read more

How to get the command line args passed to a running process on unix/linux systems?

There are several options: ps -fp <pid> cat /proc/<pid>/cmdline | sed -e “s/\x00/ /g”; echo There is more info in /proc/<pid> on Linux, just have a look. On other Unixes things might be different. The ps command will work everywhere, the /proc stuff is OS specific. For example on AIX there is no cmdline in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)