Using SOCKS Proxy in Firefox

Firefox can be configured to use various different types of proxies. To configure Firefox to use a SOCKS proxy, open the Firefox Preferences/Settings window. In Mac OS X, go to Firefox -> Preferences. In the Windows version of Firefox, go to Tools -> Options.

Go under the Advanced tab, and under the Network tab. From there, click on Settings.

Choose Manual proxy configuration. Leave everything empty except the SOCKS Host and Port. The SOCKS host and port should be the respective host and port.

HTML5 Upload Multiple Files to PHP

HTML5 provides us with the ability to upload multiple files with a single <input> element. While it has been possible to upload several files within one form field, users had to manually select the files one by one. With a few files that may not be an issue, but it will get tedious when uploading a larger number of files. Previously, it has been possible for web developers to implement a similar solution in Flash, but now it can be done natively with HTML5. Here is an example on how to get the <input> element to allow multiple files:

<form action="" method="post" enctype="multipart/form-data">
	<input name="uploads[]" type="file" multiple="multiple">
	<input type="submit" value="Upload!">
</form>

Note the name of the <input> is uploads[], with a bracket. While the bracket is not required for multiple file selection, it is required for PHP to process the files. The following PHP snippet can be used to process the files uploaded using the code above:

<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
	foreach($_FILES['uploads']['name'] as $id => $name) {
		rename($_FILES['uploads']['tmp_name'][$id], 'uploads/' . $name);
		echo "<p>$name uploaded successfully!</p>";
	}
}
?>

The PHP script will take all the files uploaded and place them into a folder named ‘uploads’. For it to work, the uploads folder will need to exist already, and needs to be writable by the web server. It’s recommended that you DO NOT use the exact PHP script in a production environment, as it’s dangerous to not check the file being uploaded. You don’t want others uploading a malicious PHP file and executing it on your server.

Adding Additional IP Addresses in Windows 2008

Start -> Control Panel

Click on Network and Sharing Center.

On the left side under ‘Tasks‘, click ‘Manage Network Connections‘.

Right click on ‘Local Area Connection‘ and click ‘Status‘. From there, click on ‘Details‘.

You will be presented with a whole list of information. Note down the ‘IPv4 Subnet Mask‘, ‘IPv4 Default Gateway‘, and the two ‘IPv4 DNS Servers‘. Afterwards, simply clock Close.

Right click on ‘Local Area Connection‘ again and click ‘Properties‘. Highlight ‘Internet Protocol Version 4 (TCP/IPv4)‘ and click on Properties.

Choose ‘Use the following IP address‘ and fill in the fields with the information provided previously when you clicked Details. This will be the settings for your first IP address.

To specify the additional IP addresses, click on Advanced. Click ‘Add‘ under ‘IP addresses‘ to add more IP addresses.

The ‘IP address‘ should be the IP address. The ‘Subnet mask‘ should be same as the one for the first IP address.

From there, click Add, OK, OK (and so on) to save and apply these settings.