How to use Core Data with multiple Store Files

Sometimes it can be useful to split your Core Data Store File across multiple files. For example, one file could live on the local file system, while the other could live in iCloud. We can do this by telling the Xcode Model Editor to add more than one Configuration, each of which can be allocated […]

How to style the Tumblr Widget Sidebar Plugin

tumblr-logoI’ve been recently using Tumblr more to post sketches from all kinds of devices, and naturally I wanted to embed them in some of my websites’ sidebars.

I found the extremely helpful Tumblr Widget plugin by Gabriel Roth for this: install, drag in the widget add Tumblr URL. Done!

I wanted my images to be in a size that the widget didn’t offer, so I did some tweaking – perhaps it’ll help if you’re in a similar situation.

Read more

MySQL Replication Troubleshooting

crab-iconSometimes things don’t work out with replication. When I first started experimenting with it I thought this was a “setup and forget about it” kind of job.

Experience has shown though that you have to regularly triple check and see if things may have broken (despite a good and once working setup).

Let’s take a look at what you can do when your Slave isn’t replicating anymore. If you want to know more about how to setup replication, have a look at my previous article in which I explain how this works.

Read more

How to setup MySQL Master/Slave Replication with existing data

mysqlThis is a step-by-step guide on how to replicate an existing MySQL server. The server is live and contains data and needs a constant backup companion.

Many tutorials focus on how to setup replication when no data is present on the system. That’s an ideal solution if you’re building a new setup, but in case you’ve got a server that already has data present then here’s how to accomplish the this:

  1. setup your existing MySQL server (with data) as a Master
  2. export all your databases and user accounts
  3. create a slave and import all your data
  4. start replication

I’ve done this several times and always forgot to take some notes – until today. Without further ado, let’s replicate MySQL.

Read more

How to install CentOS 6 on a Samsung NC10

NC10

Today was a rather exciting day for me: I’ve successfully turned my aging Samsung NC10 Netbook into an internal server in our office.

I bought the little guy in 2009 and he’s been my trusty companion on many jobs before I got an iPad. He still works fine, even though Windows XP was getting weird of late – and admittedly I hadn’t even turned him on in over 8 months.

Now my trusty pal is running CentOS 6.4 while sitting quietly in a corner next to the printer, serving as an internal Linux server. This is great for testing and automated backups – and in the same spirit as playing with a Raspberry Pi (in a much neater battery powered package).

Refreshing the NC10 wasn’t a picnic though, and some of the steps are rather involved. Here are my notes, in case I either have to do it again or you want to follow along.

Read more

How to create an NSDate object

The easiest way to create an NSDate object is to create “right now” with our convenience method date: NSDate *myDate = [NSDate date]; But if you want to create a date object with a date such as your birthday it gets a little bit trickier, and – more importantly – much less obvious. To do […]

How to display the full month from an NSDate (such as “February”)

There was me thinking I’d have to whip out NSDateComponents and NSCalendar – but my mind works too complicated at times. All we need to do this is our good friend the NSDateFormatter and the Unicode Date Format MMMM – let’s check it out: // create today’s date NSDate *myDate = [NSDate date]; // create […]