Recent Blog Posts
Blogs » Archive for March 3rd, 2004
Paying for Bandwidth
In some cases, your hosting provider may be charging you for bandwidth. In that event, you may want to be able to build your own daily, weekly and monthly reports on total throughput from your server(s).
There are several methods for doing this, however, some open source apps happen to be ready-made for just this and can be housed directly on your web server if you prefer.
These apps can measure not only traffic on multiple ports (i.e not only port 80, but toal throughput could include port 21 - FTP, 22 - SSH, 23 - Telnet, 25/110 - SMTP and POP as well as any custom ports for web applications you manage) but can also provide monitoring of disk space, cpu and memory utilization and more for your own systems management. Finally, these applications enable you to perform the simple math to verify total bandwidth based on your ethernet card(s) traffic. NOTE: Neither of these applications has been certified as usable for billing purposes, however, I believe they can be used to analyze the bandwidth reports provided by your ISP for hosting billing.
MRTG, which stands for Multi Router Traffic Grapher, and Cricket, easily manage the data acquisition …
ObjectSpaces Explained
ObjectSpaces
Following the introduction to Whidbey article, this blog will feature some new, more advanced features and technologies in Whidbey.
The first technology to look at, and be prepared for, is ObjectSpaces. ObjectSpaces allow you to map your database tables to actual objects you can create and manipulate in your code. Yes, no more scrappy SQL statements :) But ORMs for .NET aren’t new. There are many implementations out there already, but ObjectSpaces is Microsoft’s first step into ORM (Object-Relational Mapping) and as you’ll expect from Microsoft, it’s clean in its design, easy to use, and simple to deploy.
So how does it work? Whereas before, where you’d create a database and some tables, and then use a DataReader or a DataSet to work with results from a SQL statement, using ObjectSpaces, you define mappings between your tables and a class you’ve created in your application which represents the same structure. And once you’ve created an instance of your class, you can tell ObjectSpaces to watch your instance, and update the database accordingly.
Let’s look in this in action. We’re going to create a very simple Zoo, to which we can add some animals and use a simple XML file as our …
Notes on PHP Session Security
Summarizing a discussion from here - things to watch out for when using sessions for your sites login system;
1. Shared web servers - anyone else on the server can read your session files (typically in the /tmp directory) if PHP is running as an Apache module (so the session files belong to the web user) and possibly when PHP is used as a CGI (depending on how sessions are implemented).
Someone browsing the session files (probably) won’t know the site the server the sessions apply to (so may not be able to use a username / password combination they found) but you may still be putting sensitive info (like credit card details) somewhere for all to see. Plus they’ve got a list of valid session IDs…
If you’re just storing passwords in the session, you can get away with this by using md5() (preferably twice) to one-way encypt the password. This doesn’t help though if you need to recover the value of a session variable.
Using a custom session handler to store the sessions in a database is probably the best solution. You might consider MySQL HEAP tables if performance is an issue (assuming MySQL running on same machine as Apache). …
An exciting future for Mozilla
The Mozilla Developer Day 2004 took place on February 27th, and coverage of the event has started to filter through to the web. So far the most revealing information is to be found in Brendan Eich’s slide presentation entitled Mozilla Futures. Brendan is Mozilla’s Chief Architect, and incidentally is also the guy who invented Javascript for Netscape back in 1995. His slides show the strategic direction the Mozilla project will be taking over the next year or so and contain some very reassuring news.
Most importantly, it looks like Mozilla’s SVG support will finally be receiving some heavy development time. SVG is seen by the team as a critical component of so called “rich” applications, and combined with XUL could pose a legitimate competitor to Microsoft’s forthcoming XAML (expected some time this decade with the eventual release of Longhorn). Goerge Coa’s presentation, briefly described in this blog entry, talked more about this topic.
The other exciting nugget from Brendan’s slides is that Mozilla looks set to provide integration with more heavy-weight programming languages than Javascript, definitely including Python and possibly including Perl. is even mentioned, although it would only be availaable in trusted XUL applications rather than public …
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.
Download sample chapters of any of our popular books.




