Monthly Archives: July 2010

Write HTTP request to web server with PHP.

I’ve recently built a proxy server that manually handles a lot of HTTP exchanges. I summarized the proxy’s read/writing to the server here. It actually is very simple: format a request in the form of an HTTP header, send the request to the server, and then read the server’s response. // OPEN SOCKET TO SERVER [...]

Posted in Programming | Tagged , , , | Leave a comment

Using reduce in Python.

Python has a built in operator called reduce. This is just another name for what a functional programmer would called a fold. They’re really useful, but you don’t know so until you actually need one. The easiest example to understand is listed below and is the same example provided on Python’s documentation. lon = [1, [...]

Posted in Programming | Tagged , , | Leave a comment

How to reload nagios configuration as user nagios.

Hopefully you’re running Nagios under a special user with restricted permissions – mine is named nagios. There are many times when we’re adding and removing configuration files that we need to reload the configuration without restarting the service. The /sbin/service command usually requires elevated permissions and thus isn’t a tool that we can use to [...]

Posted in Nagios | Tagged | Leave a comment