Flash: Setting up the Cross domain XML policy file

One of the annoying "features" of security is that you constantly have to keep working around it, legitimately.

In order for your flash file to access data on other servers, you have to set up a crossdomain.xml file in the root of your domain.

For example, this is at http://somehost.com/crossdomain.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<allow-access-from domain="*.yourhost.com.au"/>

Replacing "yourhost.com.au" with whatever remote server you wish to access.

You can also have multiple "allow-access-from" elements to allow multiple domains. For more information see source.

Hope you didn't spend too long looking for the answer to this one!


Eclipse: Ignore certain files in project such as .git and .svn

For some time, the only way to ignore certain file types in Eclipse was to create a plugin.

Resource filters were added recently (apparently in 3.6 Helios) and I had only discovered them recently.

They solve one of the biggest gripes I've had with Eclipse so far. The ability to ignore any file matching a pattern (such as compile .pyc python files, MacOSX .DS_Store or thumbs.db).

It can also extend to folder paths so we can ignore those pesky .git or .svn folders and all of the unnecessary files within them.


Enough complaining, more removing!

For this example, I'll be showing how to hide all .git folders and their contents. This can be substituted for .svn.

  1. First step, open your project.
  2. Right click, Properties
  3. Expand Resources and click onto Resource Filters
  4. Click "Add"
  5. Use these settings

Filter type: Exclude all.

Applies to: Folders

Click "All children (recursive)" as any subfolders containing your pattern will still show up (common case for .git and .svn)

File and folder attributes: Name matches .git

OK to save!

Click Apply when ready.


Eclipse will now refresh and rebuild the project.

If you're ignoring file names, use the following settings instead.

Applies to: Files

Matches: *.pyc (or .DS_Store, thumbs.db, etc)

No need for all children.

Great feature, very flexible but pain in the ass if you've got 15 projects...

Very much worth setting up if you're working over a remote connection, it saves a LOT of time refreshing your project even if it's a LAN connection.

Happy times!


Python & HTML Tidy: Checking and displaying HTML errors

The system I was building allowed for entry of HTML entities, but was used by many non-HTML familiar users.

To prevent broken HTML from entering the database and potentially breaking the site layout upon display, I needed a way of indicating that the markup was broken whilst informative enough to point to where the error is.

Luckily, the HTML Tidy library for Python does just that! Depending on your operating system, you can get it via pip or easy_install with "pytidylib".

Once you're set up, doing the actual check is easy.

from tidylib import tidy_fragment
import re

# Check for missing close tags (bold, italics, links, etc)
document, errors = tidy_fragment(data)
reobj = re.compile(r"(line \d+ column \d+ - Warning: missing </\w+>)")

missing_tags = []

for match in reobj.finditer(errors):

print missing_tags

Done and dusted!

Time for a long awaited feel-good "cat pushing another cat off a shelf GIF"!


Formatting Sony Vaio Z 2011 (VPCZ2390X) with a clean copy of Windows 7 and working dock/external GPU

I've searched far and wide for a solution to this but only found scraps of information here and there. As with my Dell, I'm not a fan of manufacturers filling up the computer with their own bloated software which only slow down the computer.

Before you begin this journey with me, you should make the most of the "Sony Vaio Care" ability to upgrade your BIOS firmware.

Ensure you've got your copy of Windows 7 x64. The drivers for the x86 version aren't available from the site so good luck with that!

You can customise your Windows image using a combination of either RT7Lite (abandoned but still works) and Win Toolkit.

Do not slipstream drivers into the disc. I'm going to provide instructions on how to install them manually. For the external dock to work, the order of installation is important!

I've never had a device be so fussy about reboots or driver install order, so please take the time to reboot when instructed. It's a bloody fast notebook anyway, so you don't really have a reason not to.

Let's get ready to free your Vaio Z from bloat!



  • WinToFlash to put the setup into a USB drive (if you don't want to install from the DVD dock)
  • Now to make yourself familiar with the drivers download page.

Note that some of these are pretty big, it's about 1.1gb all up!

So it'd be a good idea to skim through the tutorial and start downloading these before you begin formatting.

When saving, name them as such;



1. Windows 7 x64

I installed off USB rather than DVD, but the instructions shouldn't be too different from the regular install process. Just remember the main points:

  • Set BIOS to boot off "external device" (aka USB)
  • Follow the prompts and install Windows
  • Keep an eye on it until you reboot. When it reboots, get back into the BIOS and switch back to HDD as primary boot device
  • Follow the prompts until you get to the desktop

Now the fun/tedious part, installing drivers!

Before you continue ...

Tip: Before you begin, plug in your dock and leave it plugged in!

Tip: Reboot whenever it asks you to!

Tip: Follow these instructions in the order presented. Otherwise you run the risk of the dock not working.

Tip: It's a good time to disable UAC even if it's temporarily.

Installing the drivers

2. Chipset

Go nuts and install these. They'll knock off the majority of the unknown devices in the device manager.

3. External Graphics

The external graphics in the dock is next. I've got an ATI Radeon HD 6650M with my Vaio Z so that's being served.

4. Audio

Sound is up next. Follow these in order and you'll have working onboard sound, HDMI output as well as working noise-cancelling headphones.

5. Ethernet

Yay! Now we're getting the internet!

6. Card Reader

Ensures the memory stick/SD card reader is working.

7. Touchpad

Edge, horizontal and 2-finger scrolling with pinch/twist/sensitivity/etc options. You'll want this.

8. Sony Firmware Extension

This one can be found under "System Components". I have no idea what it does, but it gets rid of a yellow "!" mark in the device manager.

9. Bluetooth

10. Intel Management Engine Interface

Another one of those "I have no idea what it is" packages. Just grab and go.

11. Wireless Network

Yay, more internet!

* Update 15/10/2012: Had some issues connecting with wireless and random dropouts. Either re-install the wireless update or just install the update package without the initial.

12. Sony Shared Library

This seems to be a bunch of DLL files that Sony packages run off. Don't worry, I'll only install the important ones that do useful things.

This can be found under "System Components".

13. Automatic brightness, backlit keyboard, battery checker and bluetooth control

These utilities let you control or disable the automatic options such as;

For automatically dimming the screen when it's darker, enabling the backlit keyboard or swapping power profiles when battery levels change.

For turning on/off wireless or bluetooth individually, saving unnecessary battery drain.

14. Fingerprint reader and USB 3.0

Time to get rid of the last few "!" marks.

I can't remember if I installed these or not, but it may be useful for you.

All done!

When it's done, reboot again to lock everything in.

You should now have working FN buttons to control various things from the keyboard such as volume, brightness, display out, etc.

Notice that Sony Vaio Care wasn't installed? That .NET 4.0 resource hog is gone!

Oh, and turn UAC back on if you really want it.

Another day, another victory.


Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog