Linux NAT Masquerading HOWTO

August 20th, 2009

Here’s a really quick rundown on setting up masquerading. You’d use this to share one internet connection between multiple local network machines. It’s what most regular ‘routers’ that your ISP sends out do and it’s really easy to set up under Linux in it’s most simplest form
Read the rest of this entry »

PHP Developer – PHP Sessions

August 10th, 2009

Sessions are a useful web technology that are used on just about every interactive site out there. Sessions are an important part of all PHP development. A session is a useful method of keeping track of a user’s browser throughout different page requests. The session is dealt with via a cookie sent to the user’s browser, with an expiry time of 0, that is to say, as soon as the browser window is closed, the cookie is destroyed and the session is over.

Examples when you might use a session:

  1. A user logs in to your site, on successful login, a session is created, and the ID stored in the database along with the user’s username and password. The user does not need to pass his username and password to subsequent pages as he’s recognised by his session ID.
  2. A user is not required to log in, however as he selects options and browses through subsequent pages, we store his information entered in a session.

It is important that a PHP developer also know what not to do in a session:

  1. Do not store sensitive information in a session. It’s just a plaintext cookie sent each time the browser requests a page from your site.
  2. Do not initialize a session on the site’s landing page unless you have good reason to. Some browsers do not accept cookies and besides, it’s not polite to trigger a cookie on the user’s machine without him performing an action that warrants it.

Read the rest of this entry »

Using the Phidget Interface Kit under Linux

August 5th, 2009

I thought that it might be a good idea to write a quick high level overview of getting the USB Phidget Interface Kit working under Linux. In my case I am of course using 32bit Debian, however these instructions should mostly be portable to any other Linux based OS

Read the rest of this entry »