How to stop / start / restart Gearman Server

How to stop, start and restart Gearman server via command line took me a bit to find, so I figured I would post it for future reference...

First, know the path to gearmand and gearadmin, on my server it is:

How to STOP Gearman Server

How to START Gearman Server

Note: If you are not using a database to queue Gearman worker jobs, that means all pending jobs are in memory, all pending jobs will be lost when you shutdown! If you do use a database, your pending jobs will be available upon restart and will not be lost.

Hope this helps!


How to integrate Kiip ads into Cocos2d

Here is a quick example of how to integrate Kiip rewards into your Cocos2d game.

If you have questions or updates, please post them in the comments below, thanks! ;)


Kiip Account:
Kiip SDK:

1. Add #import <KiipSDK/KiipSDK.h>
2. Add KiipDelegate to the AppController interface

1. Add Kiip init code at the end of the didFinishLaunchingWithOptions method just above the return YES;

Note: You will need to get your "KEY" and "SECRET" from your Kiip dashboard.


1. Add #import <KiipSDK/KiipSDK.h>
2. Add <KiipDelegate> to interface


1. Added Kiip rewards call inside a CCMenuItem block call ( you would make your own method and triggers to call Kiip rewards )

That's it, if you have questions or comments, write them below!

How to Integrate AppLovin rewarded video ads into Cocos2d

Here is a quick basic example of how to start showing rewarded video ads from AppLovin using Cocos2d 2.x.

NOTE: This is just a base template, there are several bits to be improved like:
+ Handling auto load for next video
+ Handling prompting player after the video box is closed
+ Whatever you guys can think of...

Hope this helps gets you guys started with making some money using AppLovin in your apps.

If you do update the code, post it in the comments and I will update the code here, thanks!

+ AppLovin Account:
+ Cocos2d 2.x
+ AppLovin SDK 2.4.0





MySQL Cheat Sheet

While coding I tend to write or find great SQL scripts from around the web. Below will be a growing collection of SQL that I have found to be useful, time saving or hard to find. Mostly to save me from having to remember, search again for hours or dig through old bookmarks. If any of the scripts below help you out, leave me a comment or do the social sharing thing ;) thanks!

Delete Duplicates

Got a bunch of duplicates in a table that you want to clear out? Here is an easy way to do it...

Copy Table Data

Easy way to update a table from another another table.

Option #1 - If both tables have identical columns.

Option #2 - If tables do not have identical columns or you just some of the data.

Update Column With MD5 Hash

Easy way to update a column with a unique has based on existing row data.
NOTE: MD5 has been well documented as not being the most secure for encryption. Since this was used harmless unique hash and not to protect sensitive data, I used MD5. This ran in 1.5 seconds for 200k rows, much faster than looping via PHP.

First 5 Things I Learned Making iOS Games

In June of 2012, I launched my first game Math Control, an educational game to help kids learn math. I plan to keep posting about my game development experience and the overall process of building a game company.

If you are making iOS games and want to read more about my experience you can follow me on Twitter @cesarserna or sign up for my newsletter at the end of this post.

Below are five things I learned in the process of making my first game.

1. Buy Books and READ them

Everyone has a weak point right?

Be honest with yourself and understand what your weaknesses are. Start shoring up those weaknesses by reading EVERYTHING.

Don't have time, MAKE time!

Read Books!

Leave books by your bedside, on the dinner table, in the bathroom or by the tv remote!

Invest time in educating yourself, it's the best investment ever!

You say, "why should I learn about something I will hire someone else to do?"

My friend, in that question is your answer.

At some point you will need to hire someone to do what you CAN'T do.

"Fact is, you wont know how to spot a great asset when you see it, if you don't first understand what greatness should be or look like." - Cesar Serna

2.) Forget Flash and HTML5, learn Objective C

Have you been getting some of those emails or ads on how to make games without coding?

What if I told you a BILLION dollar company made the mistake of taking the easy route?

Yep, Facebook learned the hard way (Read:, to have the best performing app and thus happy customers, you always write code using the devices native language.

Look, you can keep looking for the easy way out, the difference between you and Facebook is that a BILLION dollars affords you the ability to make mistakes... Don't waste your time or money, be efficient.

Assuming that you want to make cool games and not make more Tic-Tac-Toe games, take the time to learn about Cocoa Touch / Objective C.

If you want to make games, check out Cocos2d:

And if you want to add some physics to your game, similar to Angry Birds, check out Box2d:

3.) Plant Seeds of Interest Now!

Are you waiting to tell people about your new App the day it comes out?

Then you are in for a huge up hill battle!

As of this writing, Tiny Wings 2 and Animal Mall by Trey Smith just launched.

What do they have in common?

Both started talking about their app releases months ahead of time.

Here is the teaser trailer for Tiny Wings, pretty damn creative if you ask me...

Another example of someone doing advanced marketing is Trey Smith (a well established internet marketer transitioning to game development), he has a huge email base of fans that are following his app empire building journey. Although his app has taken 9 months of development, he can now send out an email blast and make a blog post to reach thousands of interested developers and game players about his new game release.

Don't wait until your app is done, start planting the seeds of interest now!

Learn from my mistake, although I believe Math Control is a great educational math game, very few people even knew it existed when it launched!

Trust me, after reading all those books, hours and hours of coding, it hurts to say that!

4.) Build a GREAT Team

Good enough is not worth the trouble, embarrassment and pain you will suffer later.

Never compromise your standards.

Even if you don't have the money now, its best to wait and save up to get the best team players available.

It's never about not having enough money... it's always about having the discipline to save enough money to hire the best team that meets your high standards.

The hourly or project rate you pay may seem high, but in the end will seem like pennies, you will feel confident that you put forth the very best.

That confidence will carry forward when marketing your game!

5.) Mind Your Business

Unless you already have a thriving business, most of us have to work a job or existing business to fund game development.

I am no different, I am a contract coder by day and game developer by night.

Sleep, pfffttt, whatever... forget about that!

Burning the candle at both ends will run you ragged unless you set a schedule.

As the saying goes, "Mind Your Business", don't forget about what puts food on the table.

Keep a clear time schedule so that you can give work your full attention and game development your full attention.

Emails, Twitter and blogs have sucked away many of my days until I made a schedule.

Now, I have a day shift where I work only on client tasks and a night shift where I read blog posts, research and make games.

It's easy to get carried away with game development, after all it's lot's of fun!

Don't forget what puts food on the table!

Mind Your Business!