OmegaDelta.net

Hong Kong

GMail Labs features you should enable

2010-02-20 14:55

I highly recommend checking out the GMail labs features, Settings -> Labs.  Got some useful ones in there.

Default ‘Reply to all’ – changes default reply action to ‘Reply All’

Title Tweaks – re-orders the title

Inserting images – embed images into a post (useful, but a little buggy)

Forgotten Attachment Detector – reminds you to attach files

Conroy wants Google to sensor YouTube for Australia like they do China

2010-02-11 16:34

Wake up Australia.  Internet censorship comparisons between China and Australia are no longer just interesting comparisons. Your communication minister is actually involking China’s policies to help try and get what he wants.

Read this Sydney Morning Herald article.

“Google at the moment filters an enormous amount of material on behalf of the Chinese government; they filter an enormous amount of material on behalf of the Thai government.”

Google Australia’s head of policy, Iarla Flynn, said the company had a bias in favour of freedom of expression in everything it did and Conroy’s comparisons between how Australia and China deal with access to information were not “helpful or relevant”.

Google continues:

“The scope of RC is simply too broad and can raise genuine questions about restrictions on access to information. RC includes the grey realms of material instructing in any crime from [painting] graffiti to politically controversial crimes such as euthanasia, and exposing these topics to public debate is vital for democracy.”

CORE weighs in on the fact that the filter doesn’t actually do what it’s meant to do anyway:

This week the Computer Research and Education Association (CORE) put out a statement on behalf of all Australasian computer science lecturers and professors opposing the government’s internet filtering policy.

They said the filters would only block a fraction of the unwanted material available on the internet, be inapplicable to many of the current methods of online content distribution and create a false sense of security for parents.

CORE said the blacklist could be used by current and future governments to restrict freedom of speech, while those determined to get around the filters and access nasty content could do so with ease.

I just donated some money to GetUp to help spread the word on this issue.  You can too.

Safer php filenames

2009-10-18 22:09

So you’re storing user files in your PHP app, but you are worried about security (as you should). Two bad things you might encounter (amongst others): a filename with “../” so as to overwrite arbitrary files on your server, or a filename with .php in it (to run arbitrary code).

I read this idea, but his method didn’t cut it for me.

Here’s a better one:

$str = preg_replace(array('/[^A-Za-z0-9_\-.]/', '/.php/'), '_', $str);

This nukes anything that’s not Alphanumeric or -,.,_. It also nukes any .php sequences.

For this I think a whitelist is better than a blacklist. Should I block anything else out?

Test case:

$str = '../tryToOverWiteMyScriptNow.php';
$str = preg_replace(array('/[^A-Za-z0-9_\-.]/', '/.php/'), '_', $str);
echo $str;

Protected: Time for a VPN

2009-09-10 21:34

This post is password protected. To view it please enter your password below:


Sharing the Internet to your iPhone from your MacBook (securely)

2009-02-08 21:59

OK so the iPhone doesn’t use your computers internet when connected via USB. Why? I dunno it’s one of the sadly lacking features on an otherwise awesome device.

Sharing the net however via ad-hoc wifi is easy. In System Preferences, go to “Sharing”, select Internet Sharing (don’t tick it yet), tick ‘Airport’ then tick ‘Internet Sharing’.

After you’re done – go into the Network Settings -> AirPort, and create a new network with a password (to stop those leechers). By default it is shared without a password which is dangerous (unless you’re in the desert or something). This new network should have the sharing on it if you did it right – but go back to the sharing tab and double check that it’s still enabled. Then on your iphone connect to your new ad-hoc network and enter the password.

Update: at least in Snow Leopard there is a button on the Internet Sharing settings named “AirPort Options” which allows you to setup the Wifi password in a better (more permanent) way than the one I described.

Update2: I have had some issues with sharing certain networks in Hotels – the iPhone can connect to my computer, but not the internet. One option is to install the proxy server Squid. This isn’t easy, and unless you are a developer with bash experiance I don’t recommend it (if you know what you are doing though it’s easy – just install the unix build tools, download squid, then ./configure, make and run it… default settings are fine – and just set the proxy IP in the iPhone to be that of your computer)

If you have no Wifi card (e.g. on a PC) then bad luck. If you’re on windows I’ll leave it up to you to figure out I’m sure there’s a way :-)