How to retrieve the current User Locale

The following method will return a two letter code of which language is set on the iOS device in question: NSString *myLanguage = [[NSLocale preferredLanguages] objectAtIndex:0]; There’s a list of language codes on Wikipedia: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes Note that to compare the current value against a list of languages you support we need use the isEqualToString method. Here’s […]

How to bring back Scheduled Backups in Plesk 11

For those of you who hadn’t noticed, automatic scheduled backups are no longer working in Plesk 11 with some distributions. It’s not just you, and it’s not just your configuration. It’s a known issue according to this forum thread.

Lucky for us there’s a simple script which can bring this ever so important functionality back. Why Parallels is not addressing this with a Micro Update is beyond me (we’re already at 11.0.9 MU15 and it’s September 2012 at the time of writing).

In this article I’ll show you how to install the script step by step. I assume you’re logged onto your system as root and know your way around the command line.

Read more

How to move very large MySQL Databases

I’ve been shifting some things around and came across several very large WordPress databases for a few projects I was hosting. The largest was 1.3GB or 317MB compressed (!) which obviously poses a problem. Most sites – even those of frequent bloggers – amount to well under 2MB when compressed, but Multi Site or BuddyPress databases can get large quick.

To extract a database from a WordPress site, I’ve always relied on the superb WP DB Backup by Austin Matzko but even that timed out after 170MB.

In this article I’ll talk you through how we can handle this. I’m assuming here that a simple phpMyAdmin export/import isn’t working for you anymore. This is by all means not the only way to go about this task.

Read more

DNS Servers from OpenDNS

I was on the phone to Apple Support the other day. Among many other things they suggested that I use the OpenDNS servers for local DNS queries on my system rather than mu router’s. An what do you know – they work faster indeed. Here they are – in case I forget: 208.67.220.220 208.67.222.222 To … Read more

How to fix Duplicate Counter Error in OSSEC

You may come across a duplicated counter / duplicate error in OSSEC. This can happen when you try to add an agent to the server again which was previously added (say when you had to rebuild the OSSEC Server).

The agent is basically saying “hey I’ve got some data here which doesn’t line up with what I should be getting from the server”.

This problem can be resolved easily – let me show you how.

Read more

How to localize your project in Xcode 4.4

Before we start we need to create a new file called Localizable.strings (from File – New – Resource – Strings File). Xcode needs one file per language. Next we create localized copies of our files: head over to your Project Editor (the big blue icon) select it again under Project (another blue icon) make sure […]

How to link to an iOS App

Direct web link to your app or developer account showing all your apps: http://itunes.com/apps/my-app-name http://itunes.com/apps/my-developer-name itms://itunes.com/apps/my-app-name (opens iTunes) itms://itunes.com/apps/my-developer-name (opens iTunes) itms-apps://itunes.com/apps/my-app-name (opens App Store) itms-apps://itunes.com/apps/my-developer-name (opens App Store) Direct link to a country specific app store (say Germany in this exampe): http://itunes.apple.com/de/app/my-app-name If your app name contains spaces replace them with dashes. Replace http […]

How to add version control to an existing project in Xcode

Setting up a local GIT repository: Open Terminal and change to the directory where your project is located (cd /path/to/your/project). Then use the following shell commands: git init git add . git commit -m “my initial commit (or any other comment you feel like)” NOTE: as of Mountain Lion you need to install the Xcode […]