Procedure for setting up nginx as a reverse proxy on Amazon’s Linux distribution, with Apache running in the background. …Read the Rest
Month: November 2010
Using the Hosts File to Test Virtual Servers
As it becomes increasingly easy to deploy servers in a cloud, we often find ourselves wanting to test changes to servers on a running instance. Prudence advices against experimenting on a production server, but there are times when it is necessary to test on a fully functioning instance. For instance, if one wishes to switch… Continue reading Using the Hosts File to Test Virtual Servers
Installing vsftpd on Amazon’s Linux AMI
By default, Amazon’s Linux AMI provides only the amzn repository. While this repository does have quite a selection of packages, there are a few commonly used packages that are missing (e.g. php-mcrypt). On the FTP side, the only FTP server included is VS-FTP (vsftpd). While my personal preference has historically been pure-ftpd, this is a… Continue reading Installing vsftpd on Amazon’s Linux AMI
Decoding a Base64 Email Attachment
I had a few files containing email attachments that needed to be converted into usable files. The following code (which has no checks in it), did the trick: <?php function decode_email_attachment(){ $data= file_get_contents($inputfile); file_put_contents($outputfile, base64_decode(str_replace( “\r\n”, “”, $data ))); } ?>
Basic Email Analysis
Despite ever increasing security, it appears that email accounts are breached more often now than ever before. Quite possibly this comes down to the user as opposed to the email service itself. The focus of this article includes distinguishing between spam sent from an unknown account and illegitimate emails sent from a known account; a… Continue reading Basic Email Analysis
Keyboard Annoyances
As with everything, increased computer usage tends to form certain habits. In most cases, there is nothing wrong with this, however, when things change, these habits can be significantly disrupted. Two such irregularities, and their solutions, are outlined below. The International Keyboard Many laptops come with keyboards that natively support multiple languages (e.g. provide accents).… Continue reading Keyboard Annoyances
Hardening PHP with Suhosin
Suhosin is a package designed to harden PHP, in the sense that it addresses potential vulnerabilities that might be introduced through user scripts. It comes as both a patch which can be applied directly to the PHP source code and as an extension that can be built for PHP. This article looks at how to… Continue reading Hardening PHP with Suhosin
Fractions
For many people the mere mention of fractions elicits a wince, and while these lovely math constructs played a notable role in our early years of math, they are reasonably simple entities. While most humans revisit fractions over many years and often still fail to grasp the concept, for a computer, the elementary operations with… Continue reading Fractions