logo
  • About us
  • What we do
  • Our product
  • Recent work
  • Contact

Feedback

In Focus

  • Flash XML slideshow
  • Database training

Tech report

Drupal's magic numbers

What are the magic numbers?

I'm often asked about just how scaleable Drupal is. How many unique site visitor-visits (uniques) can Drupal sustain? How long will pages take to load? What happens to that capacity if I upgrade the server or turn on more modules?

The answers aren't simple. As Drupal and the server hardware that runs it evolve, they're constantly changing. I work off 100,000 uniques/month, logged in, 4-5 mean pages/visit, dedicated single quad-core server. The real question? Is Drupal right for you?

  • Tech report
  • Read more

Deleting symlinks with SVN

Beware of deleting symlinks with SVN

The remove unix command (rm) is capable of safely deleting symlinks

rm symlink

but not

rm symlink/

as including the trailing slash tries to delete the directory and therefore throws an error

rm: cannot remove `one/`: Is a directory

svn delete symlink returns an error message that makes me very nervous, saying that it can't delete a file from within the directory.

  • Tech report
  • Read more

Amazon S3 pickle

I seem to have got myself in a pickle with Amazon's Simple Storage Service (S3). I signed up for S3 and JungleDisk, using the latter to upload thousands of files to the space that I paid for on a monthly basis.

Unfortunatly I found the rate of file transfer too slow and without a decent alpha differencing algorithm, updating my collection of files became too slow. JungleDisk then decided to start charging for their software and that tipped the balance. I decided to empty the account in order not to be charged for it any longer.

  • Tech report
  • Read more

Javascript show object

Here's how to show the contents of a object in Javascript

function concatObject(obj) {
  str='';
  for(prop in obj)
  {
    str+=prop + " value :"+ obj[prop]+"\n";
  }
  return(str);
}
  • Tech report

Calling Javascript from Actionscript

I've been grappling with Actionscript (Flash) intregration recently, largely for synchronising the dynamic elements here. In AS2, here's how it's done.

To call a function

Actionscript code

import flash.external.ExternalInterface;

ExternalInterface.addCallback( "methodName", this, method );
function method() {
   trace("called from javascript");
}

Javascript code

function callAS() {
   swf.methodName();
}

To push a variable

Javascript code

  • Tech report
  • Read more

Internationalised database design

The database schema below outlines how a website could be designed from the ground up with Internationalisation (language support).

  • Design (.gif)
  • Design (.xls)

Put this together for a forum post on underscore@under-score.org.uk.

  • Tech report

SELinux will mess with your cURL

Fedora Core 5 ships with SELinux. Even having installed all the requisite Apache, PHP and Libcurl packages, cURL may not work correctly. It's not a package dependency conflict, or a bug - just an overprotective security manager keeping things safe.

I encountered this behaviour when trying to send a post request from my server to another. It manifested itself as a 'Failed to connect to XXX.XXX.XXX.XXX (ip): Permission denied'.

By default 'Allow HTTPD scripts and modules to connect to the network' is unticked in 'system-config-securitylevel' ('SELinux' tab). Relaxing this security restriction solved the problem.

  • Tech report

Naming desktops

Fantastic technologies like RDP and LogMeIn mean that the I'm spending a lot of time logged into remote machines. Like many users, I like my Desktop to look a certain way, so I configure my user account on each of the remote machines to look similar, if not identical, to my local machine. The problem is that I can't always see at a glance what computer I'm working on.

Taskbar naming

Taskbar naming using Toolbars

...but now here's a fix. You can effectively write names onto the Taskbar by configuring a custom Toolbar. Right-click the task bar, select Toolbars -> New Toolbar. Windows prompts you to select a folder, intentionally one containing a set of shortcuts making up this toolbar.

  • Tech report
  • Read more

Setting up sshd for Windows

Cygwin provides Unix/Linux services for Windows. For small organisations, those without a dedicated Linux server, Cygwin enables tunneling of less secure services, such as Windows Remote Desktop Connection (RDC) through port 22 (SSH). Crucially, it mitigates the need for exposing insecure ports to the Internet, which compromises security and increases the likelihood of digital intruder attacks.

The following instructions comprise a rough guide:

  • Install OpenSSH, and dependent packages, using the Cygwin installation tool (CTRL + click to run)
  • Tech report
  • Read more

Negative % mod alternative

In writing this circular buffer class, I was faced with an interesting problem. I wanted to pass a negative offset (e.g. -2) to the get() method, but bound that within the range of allocated array cells (e.g. 0-3).

One option would be to rely on Java's mod function: e.g.

  • k = Lookup((next_free_slot + offset)%total_slots)

Alternatively, this negative mod could be replaced by a positive mod, by adding the total number of cells to the offset:

  • k = Lookup((next_free_slot + (total_slots+offset))%total_slots)

The attached code implements a Circular Buffer in Java, using this positive mod method. (CircleBuff.java has been renamed CircleBuff_java.txt for browser compatibility.)

  • Tech report
12next ›last »
Syndicate content  

 

 

Copyright 2007 Lightenna Limited

  • About us
  • What we do
  • Our product
  • Recent work
  • Contact