BSA 728x90 Center Banner

Creating a worker process on Cloud Foundry with Clockwork

I just got finished writing a Rails application that requires a 'cron'-like job to run every 30 seconds. This job will scrape a website for data every 30 seconds and update the database and notify me via SMS about any changes. I was able to get this all working on Heroku after a while with the assistance of some Procfiles. but I wanted to try this on Cloud Foundry as well.


The problem existed because of lots of out-of-date documentation on the part of Cloud Foundry. The most confusing part was not understanding this requires 2 containers/applications. One for the app, and another for running the clockwork task. In Heroku, this requires 2 Dynos as well because 1 is for 'web' and the other is for 'clock', however, this is all masked behind Heroku's magic.


So how do you create a worker process? I was going back and forth creating rake tasks, then tried putting logic into my controller, and having everything ultimately fail. After some trial and error, I found out the best & easiest way is to put all the logic into the Modal. Once the logic is in your modal, you can easily call it by doing Modal.method.


Second, add the clockwork gem to your Gemfile, then create the file "lib/clock.rb". Follow the gist below to configure your clock.rb file. Specify the Modal.method that you wish to call.


Great! now we just need to build our manifest.yml file for Cloud Foundry. The important thing to remember is that we are essentially going to spin up 2 applications. The first container will be the web front-end of our rails app, and the second container is just the clockwork reoccurring job. If your reoccurring process will need to make changes to the database (which it most certainly will) make sure you append the correct services. In this case, both of my containers will be using the same database.

Add a comment
Read more: Creating a worker process on Cloud Foundry with Clockwork

Phonegap Cordova Geolocation Integration with Google Maps Javascript API v3

I'm venturing into a new world of hybrid mobile development to test the waters and I have a new project I'm currently starting. I can't divulge the specifics yet, but the very first part is to get Google Maps working. I had a harder time doing this than I thought.


At first I tried using the recently released phonegap-googlemaps-plugin and got it semi-successfully working. I had it working in both iOS and Android but then came to find out that you can't use the Places API to find POIs on the map. That won't work so I reverted to using the old Javascript API to show in 'browser' mode instead of the native SDK. I came across  Implement Google Maps API on PhoneGap Using the Device API and struggled for 2 days on trying to figure out exactly why it wasn't working. It was a combination of type, outdatedness, failure to copy/paste, and missing CSS variables. I'm going to recreate it to make "spoonfed" useful.


You can see this entire project at or look at this Gist for the entire code: Phonegap Cordova Geolocation with Google Maps Javascript API v3


Add a comment
Read more: Phonegap Cordova Geolocation Integration with Google Maps Javascript API v3

A Move Into "Full Stack IT"

Last week I published a blog post detailing my shift into code and development. One very important thing I purposely left out was “What am I going to do with it?”. 


For the past 7ish years, I’ve been dealing with infrastructure and operations. Things got complacent so I wanted to learn some new skills on the other side of IT, programming and software development. To be clear, I don’t plan on becoming a full-time developer because that would essentially mean starting my career over from scratch. Instead, I want to do what I call “Full Stack IT”. I can configure networks, build virtual farms, deal with storage, do that thing called “cloud”, script, and hack code with varying front-end & back-end languages. My code is “good enough” to get the job done. :)


If you’re thinking I plan on creating my own software startup and selling it to Google for $200 million… well, maybe one day.


Next week I’m beginning a new role with EMC as a Developer Advocate. I’m very excited to be joining a new team with the likes of Clint Kitson, Jonas Rosland, and Brian Gracely. Our team is tasked with a few different goals in mind. 

Add a comment
Read more: A Move Into "Full Stack IT"

Where has my focus been the past few months?

I'm sure everyone has probably noticed a steady decrease in the amount of blog posts I put out. If you pay attention to twitter, you might have seen a shift in my focus.


VMware has been good, but there comes a time when you need to pump the brakes. I've reached a point where I don't care about the intricate details of all the vSphere products and trying to be an expert in them. If there is one thing that VCE has taught me, it's that converged and hyper-converged infrastructure is removing the need to be in expert in the core product set. There will come a time when you realize knowing storage pathing policies or trying to understand the DRS algorithm is pointless. And with EVO:Rail coming to market (and once it becomes fully baked) you won't need to know how to administer the environment what-so-ever, negating the need for many of those VCP skills. Argue with me all you want, but the goal is abstraction from vSphere for many product sets.


I turned my focus to IaaS offerings with vCloud Director then vCloud Automation Center and UCS Director to bring everything up to a higher order of control. This is what I talk about in my every day job. But I still look at IaaS like, "there has got to be more".


I started learning Ruby back in September of 2013 and have since released a few different Rails applications including JumpSquares.netMonsterRemote, and Simple World Cup Stats. I've also started diving into more languages recently and I'll get to that later. So what led me to this point?


Add a comment
Read more: Where has my focus been the past few months?

My Synology SynoLocker Debacle

It all starts with a text message from my wife...



Of course, all of the DS iOS apps fail to connect to the device. This has happened before. I figured I'll just open up the browser when I get to my Mac and restart the services. Then I get this screen.



My first thought was WTF? Took a screencap and put it out on twitter thinking Synology installed some encryption service on my device through some automatic update. Then the swarms of "oh no..." tweets come replying back. Apparently, I must have been hiding under a rock. And I was. For the past two weeks I've been heads down doing some front-end web development training. I literally saw nothing over the prior week about SynoLocker.


Don't know what SynoLocker is? It's a form of malware/ransomware based on a different strain of the Cryptolocker ransomware. Once you are infected, all of your files are overwritten with an encryption algorithm that can only be decrypted with a key held by the person that created the strain. Essentially, your files are gone unless you pay the person a certain amount for the decryption key. SynoLocker ransomware scans the internet for port 5000 and 5001 and will return a Synology ACK. This means you have to have the management port of 5000 & 5001 exposed on the internet. Once discovered, the ransomware plants itself through an exploit and begins encrypting your files. The files targeted are <100mb because the larger the file, the longer the encryption process takes. Their target were smaller files such as documents and photos.


Add a comment
Read more: My Synology SynoLocker Debacle

JumpSquares 1.3.1 with Updated CSS

I'm going through some front-end web development training and the first few courses have been over CSS. We're all pretty accustom to manipulating CSS to do what we want to do, but have you ever started out with a blank slate and created your own CSS back-end without a template? I certainly haven't up until this point.


To utilize these new CSS skills, I figured I would update the homepage of to look like a nice fancy modern web page. When I was going through all of this, I realized I was using static containers instead of fluid containers with Twitter Bootstrap so I had to make a bunch of changes inside of JumpSquares. The latest version uses fluid containers, so we can actually cram more jumpsquares into a single screen by using every edge of space. At the same time, I fixed some minor issues in window and row spacing for twitter bootstrap. Therefore, the latest version of JumpSquares (Project Homepage) is now at 1.3.1

Add a comment
Read more: JumpSquares 1.3.1 with Updated CSS

IndyVMUG: Come watch my sessions on Docker & Cloud Foundry

Indianapolis VMUG (@IndyVMUG) is back in season again and it will be bigger than ever this year. If you've never been, it's one of the largest VMUG gatherings in the nation with a few thousand attendees. (register and see the schedule)


This year, there will be a dedicated User Content Track with a lightening talk format where all presentations are limited to 15 minutes. This is NOT in the Official VMUG Schedule so you will have to find it once you get there. If you have never been to a conference with <30min sessions, you are going to love it. With one hour sessions, people tend to start veering off into iDevice land around the 20 minute mark. These 15 minute sessions will allow you to get more out of the conference with lots of great information crammed in. This is being sponosored by the #vBrownBag folks so there will be NOTHING VENDOR RELATED!!!


I will present two lightening talks:

  1. 11:00am - Riding The Next Wave: Docker Containers
  2. 11:30am - Riding The Next Wave: Cloud Foundry


I am tentatively scheduled for an afternoon track unless all the slots are consumed and other people want to present other topics.

  1. 2:30pm - Riding The Next Wave: Docker Containers
  2. 2:45pm - Riding The Next Wave: Cloud Foundry
Add a comment
Read more: IndyVMUG: Come watch my sessions on Docker & Cloud Foundry

Page 4 of 32

Related Items

Related Tags