Installing PHP 5.3.1 on Ubuntu

Two lines. That’s all it takes. Ubuntu x64: sudo su cd /tmp && mkdir php53 && cd php53 && wget http://php53.dotdeb.org/dotdeb_all.deb && wget http://php53.dotdeb.org/dotdeb.2004.02.25.key && apt-key add dotdeb.2004.02.25.key && dpkg -i dotdeb_all.deb && aptitude update && aptitude install php5 Ubuntu 32-bit (i386): Same command. The dotdeb repository handles both architectures.

17 March 2010 · 1 min · 50 words · Shafiq Alibhai

Reading a File into a Variable in Perl

For large files, consider File::Slurp. It’s faster than the conventional approaches: # Slurp the whole file { local $/ = undef; open my $fh, '<', 'myfile' or die "Couldn't open file: $!"; binmode $fh; my $string = <$fh>; close $fh; } Without binmode: { local $/ = undef; open my $fh, '<', 'myfile' or die "Couldn't open file: $!"; my $string = <$fh>; close $fh; } Join the lines: open my $fh, '<', 'myfile' or die "Couldn't open file: $!"; my $string = join('', <$fh>); close $fh; Append in a loop: open my $fh, '<', 'myfile' or die "Couldn't open file: $!"; my $string; while (<$fh>) { $string .= $_; } close $fh; Read a fixed number of bytes: open my $fh, '<', 'sample.txt' or die "Error: $!\n"; read($fh, my $data, 2000); close $fh; The read function takes a filehandle, a destination variable, and the number of bytes to read. The example above reads 2000 bytes into $data. ...

15 March 2010 · 1 min · 183 words · Shafiq Alibhai

There Is No Such Thing as Hack-Proof Encryption

The goal of encryption isn’t to create something uncrackable. The only truly unhackable computer is one that’s turned off, unplugged, and locked in a vault – and even then, someone could just carry the vault away. Encryption is about making it difficult enough that attackers give up and move on to easier targets. It’s a cost calculation, not a guarantee.

23 February 2010 · 1 min · 60 words · Shafiq Alibhai

Go Programming Language - What's the Deal?

Google announced a new programming language called Go on November 10th. It’s from Robert Griesemer, Rob Pike, and Ken Thompson. That last name should tell you something — Ken Thompson co-designed Unix and invented the C programming language. The pitch was simple: a compiled language that feels as quick to write as a scripting language, with built-in concurrency and garbage collection. It’s aimed at the kind of problems that C was always used for, but without the pain of manual memory management and with better support for multi-core processors. ...

13 November 2009 · 2 min · 217 words · Shafiq Alibhai

Lessons Learned – from a CMS developer

After building and maintaining CMS sites for a while, here are the things I’ve learned the hard way. Don’t run your site from the root directory. Put the CMS in a subdirectory and forward requests there with .htaccess or whatever your server supports. It keeps the CMS files out of the way and makes it harder for someone to guess where things are. A small thing, but it helps. Be careful about advertising what CMS you’re running. ...

9 October 2009 · 2 min · 311 words · Shafiq Alibhai

Sales and Distribution module (SAP)

Notes on the SAP SD (Sales and Distribution) module from an implementation project. Mostly for my own reference. What SD does SD covers the sales process from order to cash. It handles customer master data, pricing, orders, deliveries, shipping, and billing. It’s integrated with other SAP modules — MM for materials, FI for finance, PP for production — so changes in SD ripple through the rest of the system. Organisational structure ...

6 August 2009 · 3 min · 440 words · Shafiq Alibhai

Final Year Project Abstract — Test Automation in ERP Applications

This was my final year project for the B.Tech in Computer Science and Engineering (2008–09), done with K. Nishant. Test Automation in ERP Applications: Optimisation and Enhancement Most large organisations run their business on packaged ERP systems like SAP, Oracle, or PeopleSoft. These get heavily customised to fit each company’s processes, and testing those customisations is expensive and time-consuming. The goal of this project was to build a test automation framework that could run hundreds of test scenarios from a single script. ...

6 August 2009 · 1 min · 187 words · Shafiq Alibhai

9 skills developers will need in the next five years

I was reading through some job listings recently and noticed a pattern. The same skills keep appearing, and the ones that were important five years ago are shifting. Not disappearing entirely, but moving around. Here’s what I think developers should be focusing on right now if they want to stay employable over the next few years. This isn’t exhaustive. There are plenty of specialisms and niches I’m ignoring deliberately. I’m thinking about mainstream development work, the kind most people do. ...

12 July 2009 · 5 min · 946 words · Shafiq Alibhai

Flash z-order — always on top?

I had a JavaScript pull-down menu that overlapped with a Flash movie. No matter what z-index I set, the menu always rendered behind the Flash content. Classic problem. The fix is to set wmode to transparent on both the <object> and <embed> tags: <object ...> <param name="wmode" value="transparent"> <embed ... wmode="transparent"></embed> </object> This tells the Flash player to respect the browser’s stacking context instead of rendering in its own window layer. The menu displays correctly over the Flash movie after that.

1 July 2009 · 1 min · 81 words · Shafiq Alibhai

Choose your titles wisely for better URLs

If your CMS generates URLs from page titles, choose those titles carefully. The slug becomes part of the URL and search engines use it as a ranking signal. Use hyphens to separate words, not underscores. Google treats my-page-title as three distinct words but reads my_page_title as one mangled string. Good: /blog/choose-your-titles-wisely-for-better-urls Bad: /blog/choose_your_titles_wisely_for_better_urls Keep titles short and descriptive. Avoid stop words where you can — “the”, “and”, “of” take up space in a URL without adding meaning. And watch out for special characters; they get mangled into ugly encoded strings.

20 June 2009 · 1 min · 90 words · Shafiq Alibhai