Popular recipes by Gui R http://code.activestate.com/recipes/users/4166241/2010-03-16T13:24:22-07:00ActiveState Code Recipessubprocess.terminate() not always implemented (Python)
2009-02-25T10:45:01-08:00Gui Rhttp://code.activestate.com/recipes/users/4166241/http://code.activestate.com/recipes/576667-subprocessterminate-not-always-implemented/
<p style="color: grey">
Python
recipe 576667
by <a href="/recipes/users/4166241/">Gui R</a>
(<a href="/recipes/tags/process_management/">process_management</a>, <a href="/recipes/tags/subprocess/">subprocess</a>, <a href="/recipes/tags/terminate/">terminate</a>).
Revision 2.
</p>
<p>The new subprocess module brings clarity and simplicity over the popenXX() functions and os.spawnXX() functions, but some implementations don't have the subprocess.terminate() method, which is crucial for killing a spawned process. This workaround works on both POSIX and Windows.</p>
How to detect the Linux distribution from an init.d script (Bash)
2010-03-16T13:24:22-07:00Gui Rhttp://code.activestate.com/recipes/users/4166241/http://code.activestate.com/recipes/576676-how-to-detect-the-linux-distribution-from-an-initd/
<p style="color: grey">
Bash
recipe 576676
by <a href="/recipes/users/4166241/">Gui R</a>
(<a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/redhat/">redhat</a>).
Revision 2.
</p>
<p>There is no trivial way to know what Linux you are running. Red Hat, SuSE, etc., each distribution has a different way to tell what version is installed.</p>
a more reliable DOCUMENT_ROOT (PHP)
2008-12-25T18:55:33-08:00Gui Rhttp://code.activestate.com/recipes/users/4166241/http://code.activestate.com/recipes/576595-a-more-reliable-document_root/
<p style="color: grey">
PHP
recipe 576595
by <a href="/recipes/users/4166241/">Gui R</a>
(<a href="/recipes/tags/web/">web</a>).
</p>
<p>$_SERVER['DOCUMENT_ROOT'] has been known to be broken on some servers.
This is a bit of logic to retrieve the document root more reliably.</p>