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 […]

How to style a table view header / footer

The UITableView implements a header and a footer when you’re using the tableView:titleForHeaderInSection method (tableView:titleForFooterInSection respectively). However when the header (or the footer) is displayed you can’t change the font or colour of your text. You can however implement the following methods in your table view delegate and create a custom UILabel object for the […]

How to add a background image to a table view

The easiest way to do this is by adding a UIImage to your table. Rather than instantiating a new table object you can simply add the following line into the first Table View Data Source method you have – such as this one: – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { tableView.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@”background.jpg”]]; // Return the […]