Category Archives: Snippets

AppleScript Fix for Error 51: Unable to communicate with the VPN subsystem on Cisco 3000 VPN Client

Over at Ian Talks Tech my friend Macca recently posted a fix for the “Error 51 : Unable to communicate with the VPN subsystem” error from a cisco vpn client. I had also encountered the same problem some time ago and it brought my own memories rushing back. I had initially discovered a fix for the error 51 problem over at a different site, Anders.com . Since finding the one line terminal command answer to the issue that my cisco 3000 client had thrown up I thought no more of it. Ian’s post jogged my memory about my own search and I immediately put my copy and paste skills to good use to come up with an apple script that you can run to fix this cisco vpn client error.

All you need to do is open the apple script editor.

“/Applications/AppleScript/Script Editor.app”

Then paste a similar line of code to the commands that Macca and Anders mentioned:

do shell script "ifconfig fw0 down" with administrator privileges
do shell script "ifconfig fw0 up" with administrator privileges and password
do shell script "/System/Library/StartupItems/CiscoVPN/CiscoVPN  restart" with administrator privileges and password

Feel free to run the apple script to test it, just note you will be asked for an administrator password for the script to run.

Once you are happy you should compile and save the script to keep it safe, or “save as” and choose application. Alternatively, you could just download the AppleScript Fix for the “Error 51: Unable to communicate with the VPN subsystem” problem, that I have pre compiled as an application.

Credit where its due.
Ian Talks Tech for jogging the grey matter.
Anders.com for solving my problems when I had them.
Apple for showing me how to do shell scripts in Apple Script.

Ford Multilingual Micro Site

So I have been pretty busy of late with development of a simple Ford Micro Site. This is certainly one of the most interesting projects i have been able to work on in a while, and I have to say seems to be showing a trend towards flexible, yet visually strong multilingual sites.
Previously i had noticed that if a Flash site or presentation was required in multiple languages then the likelihood was that the creative would be paired down. The main thinking in this seemed to be a direct result of font issues, and also some of the limitations with regard to non-embedded text.

The Ford SAV site will be presented in 16 languages. The content and structure is stored and managed via external XML documents. All images and audio are managed via the xml along with limited control over the colours and ‘skin’ elements such as the background tints and locations.
Continue reading Ford Multilingual Micro Site

Flash 8 setTimeout Example

Over on theflashblog.com they have very simple example of an undocumented function in Flash 8. The setTimeout() function seems to be a nice succinct replacement for the rather cumbersome (IMHO) setInterval().

How this setTimeout() operates in comparison to setInterval() remains to be seen, information regarding return types if there are any. Also the function by all accounts seems to be a global, which may be a little problematic for those creating components or classes.

See the full example here.

AS3.0 Snippets

This Snippet allows you to embed fonts into a Flash AS3.0 Package. The original code was posted here .

[as]package
{

import flash.util.describeType;
import flash.display.MovieClip;
import flash.display.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;

public class Test extends MovieClip
{

// be sure this is pointing to a ttf font in your hardrive
[Embed(source=”C:\WINDOWS\Fonts\somefont.ttf”, fontFamily=”foo”)]
public var bar:String;

public function Test()
{

var format:TextFormat= new TextFormat();
format.font= “foo”;
format.color= 0xFFFFFF;
format.size= 130;

var label:TextField= new TextField();
label.embedFonts= true;
label.autoSize= TextFieldAutoSize.LEFT;
label.antiAliasType= AntiAliasType.ADVANCED;
label.defaultTextFormat= format;
label.text= “Hello World!”;
addChild(label);
}
}
}[/as]