A server I was recently working on kept crashing because it was getting too many connections. This is normally a sign of popularity, but when it prevents people from being able to access your product that’s not a good thing. The first step in handling an issue like this is monitoring it in real-time so that you can see what causes it and know when it’s time to restart apache. The default setting is 256, so when you’re getting close to that number, be aware.

Use this command at the terminal to get the current number of open connections:

pgrep httpd | wc -l

And if you want to monitor it in real time, watch it:

watch “pgrep httpd | wc -l”

Note that the best approach is to configure apache to provide server-status so that you can pull up all connections in a browser window, but that requires editing httpd.conf and restarting, and should be the topic of a whole other post.

Hope that helps!

 

An ipod/iphone/ipad app went on a sale last week through ebay. Starting bid was $1, and I was curious to see how much it was going to sell for.

It was called BuckShot, and it was a simple app that is described as a “Multi Player Photo Scavenger Hunt Game.” It was created back in May of 2011 and had both a paid and a free version (ad supported). Through its 7 months, it has gained 20k users and nets roughly $240/month in profit.

After its 10 day auction, it finally sold for over $16k! I’m freakin stumped by how something so new could have a price tag of that. Based on its current rate it will take almost 6 years before the new owner breaks even.

The original developer claimed he was getting rid of it because even though it was easy to maintain, he was sick of the Apple Store process and didn’t want to deal with it anymore.

Good luck to the winner, nschmidt7, I hope it proves profitable for you!

 

I kept getting this error when trying to integrate the JQuery UI DatePicker (http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker/) into one of my pages:

Uncaught TypeError: Cannot set property ‘touchstart’ of undefined

Finally realized that I was using a very old version of JQuery. Once I upgraded to the latest version it started working. Hope that helps you!

 

Over the last 6 months at my full time job, things have gotten a bit hectic. We’ve doubled our customers, added 3 more employees, and had a CEO who was busy with other projects. This had created a need for leadership and organization like never before.

I saw an opportunity to step up but I knew I couldn’t do it myself. Our company is very dynamic, changing tasks and priorities several times a day. If I was to attempt to fill this leadership void I knew I needed a tool to help us keep track of our tasks, as there’s no way I would be able to keep it all in my head or survive with a simple todo list.

I looked around for task management programs. I asked around for suggestions, searched everywhere, and even tried some on Wikipedia’s comprehensive list of project management tools. But none of them had what I wanted. All I needed was a simple tool where I could list tasks by project, assign them to people, and know with a quick glance the status of everything.

I decided to create something on my personal time. It took me about 3 weekends, but ended up with my own tool: TaskShot. It accomplished everything I needed and nothing more. I’ve been using it over the last 5 months and I couldn’t be more happy with it.

I then realized that other people may be interested in this, as it fills a pretty specific niche for small companies who need simple, yet effective task and staff tracking. Being the entrepreneur that I am, I cleaned it up a bit and have plans to market it as a hosted web app. I’ve opened it up so others can sign up for it, but haven’t advertised it, thus currently I am my project’s only customer.

Here’s where the profitability comes in: Last month I had a yearly review with the CEO of my day job. He expressed how impressed with me he was about my ability to focus on the important tasks and keep people on track. He was very happy with my project management skills and even more satisfied with my leadership skills. Immediately after our meeting, he gave me a raise of about $7k.

Yup, $7,000! Lets do the numbers: I’ve invested only my free time, $20 for a template, and a little space on a web server I already had, and created $7k. I know you’re thinking that I would’ve received a raise anyway, and you’re right, but it wouldn’t have been that much (the previous year was just a few percentage points). And I realize that it took my skills as a leader to enforce the tasks I was keeping track of, but I don’t care. The way I see it I would have received a standard raise if I did not have my task management tool.

Eventually I still hope to share this tool with others as a side-business, but for now I’m extremely pleased to be my project’s only customer, yet still profitable.

 

I recently saw a TED Talk by Graphic Designer Stefan Sagmeister. He takes the audience on a journey through moments of his life that made him happy. He focuses on which of these moments had to do with good design, but in one slide he lists bullets of “Things I’ve Learned In My Life So Far”.

Some of them caught my eye, so I thought I’d document them here for reference:

  • Complaining is silly. Either act or forget.
  • Thinking life will be better in the future is stupid, I have to live now.
  • Being not truthful works against me
  • Helping other people helps me
  • Organizing a charity group is surprisingly easy
  • Everything I do always comes back to me
  • Drugs feel great in the beginning and become a drag later on
  • Over time I get used to everything and start taking it for granted
  • Money does not make me happy
  • Traveling alone is helpful for a new perspective on life
  • Assuming is stifling
  • Keeping a diary supports my personal development
  • Trying to look good limits my life
  • Worrying solves nothing
  • Material luxuries are best enjoyed in small doses
  • Having guts always works out for me

I’d like to come up with a list of my own. I know some of them will include:

  • Life’s not black/white. Balance is important.
  • Giving is more rewarding than receiving.
  • Bad times/experiences leave you with a good story to tell.
  • Don’t worry about things you cannot control.
  • You can’t change people. Accept them as is or reject them.
  • Future planning just leads to rigidity and failed expectations.
  • Exercise is all the stress management I need.

I’ll add to this list as I gather more.

 

It’s a lot of work to be filling out a form from a mobile phone. Which is why we need to make it extra easy for them to input their data. One of the simplest things you can do is indicate that a field such as a phone number, zip code, or x is numeric. This will prevent them from having to switch their keyboard to a number pad, as it will happen automatically.

The bummer is that iPhones, iPods, and iPads react undesirably on the type=number directive. They will open the number keyboard, but maxlength is not honored and commas are auto inserted. The commas may be great for some applications, but it makes fields like a postal code look weird. The workaround on iOS devices is to specify a pattern for the input to follow.

Of course this pattern doesn’t work on Android, so you must use “<input type=”number” />” for Android, and “<input type=”text” />” for iOS.

Here’s a PHP code snippet that will detect and do this for you automatically:

//android and ios devices respond differently to number fields
$numberfieldtype = 'type="text" pattern="[0-9]*"';
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),"android"))
{
	$numberfieldtype = 'type="number"';
}

Then use this html:

<input type="text" name="zipcode" maxlength="5" <?php echo $numberfieldtype; ?>>

Hope that helps!

 

I noticed this error when adding google adsense code to one of my sites. I thought it was just happening on my new site, until I checked my other sites and realized it was happening everywhere! I had no idea how long this had been going on for, but wanted to get it fixed ASAP.

I scoured the web and researched the hell out of it. Here are the facts:

  • It has happened to lots of people. There are numerous posts on google’s message boards (Ex: http://www.google.com/support/forum/p/AdSense/thread?tid=18890327279dad00&hl=en). Google has not acknowledged it or proposed a fix.
  • It happens only on Chrome and Safari browsers. Internet Explorer and Firefox are immune to it. I have not tested specific versions, just the most recent release of each.
  • Sometimes it is accompanied with an additional error “Unsafe JavaScript attempt to access frame with URL [URL] from frame with URL http://googleads.g.doubleclick.net/pagead/ads?… Domains, protocols and ports must match.”
  • No adsense users have found a reliable fix.
  • I tried putting the adsense code on a blank page, wondering if my own html or javascript code was conflicting with it. The warnings still popped up.
  • I tried from a different computer, to see if it was isolated to my environment. Same problem.
  • I located another website that had adsense on it. Their site was giving me the same errors.
  • People have reported this as a bug in Chromium (http://code.google.com/p/chromium/issues/detail?id=61223). No solution.
  • Although it does create script errors, it does not seem to affect the functionality. Ads are still displayed, and clicks are still counted.

Since I found no solution, I thought about dropping Adsense, but since the functionality is still there and it’s still providing income, I decided to wait it out. I’ll update this post when/if I find a solution. Please share your experiences in the comments, especially if you found a fix!

 

Here’s how to have a realtime display showing how many hours, minutes, and seconds are left in the day:

Time left until midnight: <span id='HMSremaining'></span>
<script>
function calculateHMSleft()
{
	//calculate
	var now = new Date();
	var hoursleft = 23-now.getHours();
	var minutesleft = 59-now.getMinutes();
	var secondsleft = 59-now.getSeconds();

	//format 0 prefixes
	if(minutesleft<10) minutesleft = "0"+minutesleft;
	if(secondsleft<10) secondsleft = "0"+secondsleft;

	//display
	$('#HMSremaining').html(hoursleft+":"+minutesleft+":"+secondsleft);
}

calculateHMSleft();
setInterval(calculateHMSleft, 1000);
</script>

If you calculate how many days until an event, then you can append that and have a countdown timer to any holiday or special occasion!

 

Here’s how to calculate the days until Christmas using PHP:

$daysuntilxmas = ceil((mktime(0,0,0,12,25,date('Y')) - time()) / 86400);
echo "There are $daysuntilxmas days to Xmas!";

You can combine this with my End of the day countdown javascript to have a realtime countdown with hours, minutes, and seconds. If you do that, decrement the $daysuntilxmas by 1 since you will already be counting partial days.

Hope that helps!

 

I recently installed the WP Post Signature wordpress plugin so that a custom signature could be included in each of my posts. After installation from the Plugins -> Add New page, I clicked on the ‘Settings’ link from that same page and got the error: “You do not have sufficient permissions to access this page”.

What good is a signature plugin if you can’t edit it or turn it on?! I googled the issue and many people said that it was the developer’s fault for messing up the security requirements on their plugin.

THEN I figured it out! Don’t click the Settings link from within the plugin installation page, instead click the ‘Settings’ side menu and there will be a WP Post Signature item in there. It is from this area where you can customize and enable the plugin.

Hope that helps!

© 2012 ShaneLabs Suffusion theme by Sayontan Sinha