Drush – Out of Memory

So this weekend I tried to push some new changes to my staging website.  The site, musiciansub.com, is running Drupal so you basically need to run Drush to do any form of updates.  Anyways, I logged onto the server and tried to do a drush update, and I recieved this error:

Fatal error: Out of memory (allocated 22806528) (tried to allocate 30720 bytes) in /home/musici12/staging.musiciansub.com/sites/all/modules/date/date_api.module on line 105
Drush command could not be completed.

After digging around the net I found many references to PHP memory limits.  Where most people have fixed this error by simply setting the PHP.ini for Drush to use, or simply added ini_set to the drush.php file.  Here are some links;

None of these worked for me.  I always hit the 22806528 limit no matter what.  This is roughly 20M, which is really small.

The Solution

My problem was the Fork Bomb protection (http://en.wikipedia.org/wiki/Fork_bomb) that some hosting providers setup.  The basic defense is to restrict your Bash (or whatever) shell to a very limited set of resources so that its difficult to bring down the server.  In my case the memory limits.

After requesting that my hosting provider disable the fork bomb on my VPS, I’m back to being able to update my site.

I hope this helps someone, I wasted a few midnight hours trying to figure this out.

Installing a Seagate Momentus in my Sony VAIO

You’d think that installing a new hard drive would be a simple thing, well read on.   I have the Windows 7 Ultimate edition installed on my VAIO laptop already, so I decided to use the System Recovery tools that come with the Ulitimate edition (I knew that extra cost of getting the Ulitimate edition would pay off).  Plus I really didn’t want to buy Norton Ghost.  I have disgust for them with their crappy Norton 360 product.

After backing up the entire C: drive on to my 1.5 Tb USB drive using the instructions from here: http://www.sevenforums.com/tutorials/663-backup-complete-computer-create-image-backup.html and few hours later.

I created the backup and the CD to do the recovery.  Then I shutdown the laptop to install the new drive.

Here’s a big tip when changing hardware on a laptop, disconnect the battery.  I don’t know exactly why, but everyone seems to do it.

After getting the back plate off then removing all the screws to get the drive bay out of the laptop, I removed the old drives  (2 Striped 160Mb to be exact).  Installing the new drive was easy.  Everything went in ok and we’re good to go.

Then I tried to boot off the CD I made.  Well now things get interesting.  It boots up and complains that;

“System Recovery Option is not compatible with the version of windows you are trying to repair”

Ok, road block number one.  So I grabbed my original Windows 7 disk and booted off of it.  Tried the Restore again and the same thing.  Block number two.

Next, I tried to do an install of a blank Windows7 OS.  Then it wouldn’t let me install on the unformatted drive space. Things are getting annoying now.  Looking at the drive partitions I noticed that the first partition on the drive was labelled EFS.  So I Googled it: http://en.wikipedia.org/wiki/EFI_System_partition Looks like something to do with Mac machines.   Holding my breath I deleted the EFS partition.  Now some joy, I was able to create a new partition and Windows7 was happy to start the install.

After going through the install and entering in the Product Key.  I unchecked the register automatically checkbox.  I don’t want it to register, since I’ve already done this.   It asked to connect to my Wifi, I didn’t allow this either.  This means that Windows can not connect to Microsoft and no virus’ can get me.

Now the desktop is up and running. So far so good for this new harddrive, things are running really fast.  But now I need to get my original System image back on here.   I inserted the System Restore CD into the DVD drive I created earlier, and booted off it.   Watch the screen, the “Boot off CD, DVD” goes by real fast.  I missed it twice.

Using the Method 2 described here: http://www.sevenforums.com/tutorials/668-system-recovery-options.html I proceeded to reimage the system back to what it was.  It warns this may take hours, so off to enjoy some NetFlix.


Several hours later, with the progress indicator slowly creeping across it finally finished.  I rebooted and it worked great.   I had to reboot twice, and Norton 360 had a problem but it fixed itself.

The new hard drive is working great, and is a lot faster than I expected.  My laptop is back to running quick again.  Mission accomplished.

Wifi thermostat

My girlfriend always complained when we’d go up to our cabin at Tahoe during the winter because it was so cold inside. So I thought I’d install a wifi thermostat. Where we could adjust the temperature before we got there, so it’d be nice and warm on arrival.

The thermostat I chose was the Intwine IECT-210.  The installation instructions for the unit was fairly good.  Having installed a thermostat before it wasn’t new to me.  Setting up the WiFi was a little tricky, you need to download a utility from their website to do it.  The GUI for this utility is very rudimentary, even for an software engineer like myself, I found it hard to use.  The error messages were difficult to understand.  Connecting the wifi module to my laptop was easy.  I was unable to get the WEP-64 to work with my AT&T wifi router.  The utilitiy kept forcing me to enter the WEP password in all 4 entry fields before it would setup the module (connected via USB).  After switching my router to a different Encryption method (WPA) I was able to get it to work.

Installing the unit on the wall was really easy.  The instructions helped a lot.  However, after about 12 hours the batteries in the unit when completely flat.  After more carefully reading the installation guide, it turns out the the thermostat needs to be connected to power when using the wifi module.  Since the wall heater I had it connected to didn’t have a “C” power output, I had to go and buy a 12V transformer.  Now the fun part begins.  To connect the transformer I had to cut off the end of the transformers cable, strip the ends then in connect them into the C and RH inputs on the thermostat.  I had to temporarily rig up an extension cable to the thermostat to power the transformer.  I need to make a trip to the hardware store to get some more cable so that I can route it to the closest powerpoint.  Not to happy about that but, at least the thermostat is working now.

To access the thermostat remotely you have two options.  An iPhone app and the website.   I found the website to be fully featured, but it seemed to be buggy as programming the temp times of day didn’t quite work right.   But all in all it was ok.  The iPhone app was a let down, it isn’t fully featured.  So you can’t fully control the thermostat using it.   But it does satisfy our original requirement.  You can change the temp of the themostat remotely.

All in all I’m happy with the thermostat.  I’m not sure how the lay person would have a chance of setting it up.

https://www.gointwine.com

IE8 HTTPS and Proxy?

We recently came accross an issue on a website we were working on where IE8 wasn’t allowing content to be downloaded.  It seems that we needed to add “Proxy:” as a header.  This seems like a bug, but at least we have a work around.  This only happens when the connection is using https.

The Proxy RFC is defined in here:

  1. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
  2. http://en.wikipedia.org/wiki/List_of_HTTP_header_fields

Mark Milbourne

Mark, Maria and MaisyWelcome to Milbourne.com.

About myself, I’m a Guitarist, Sound Engineer, Skiier, and Software Engineer who currently lives in Northern California.  I immigrated here from Australia in 2001.  I’m into Audio engineering at the moment.  You’ll find some of my latest mixes as I learn how to use Reaper and Waves plugins.

I currently work for Certify Inc, through multiple mergers and acquisitions, where my product, Tallie, that I lead, architected and designed for the last 7 years was sold in late 2016.

Stack Overflow Flair

Stack Overflow profile for Mark Milbourne at Stack Overflow, Q&A for professional and enthusiast programmers