Sunday saw the greatest career comeback in MMA history. The original UFC Bantamweight Champion, Dominick Cruz, recaptured his title over T.J. Dillashaw. Cruz had only fought one minute and one second in the UFC Octagon in the last four years because of three knee surgeries (all torn ACLs) and a torn groin. He also came into the fight with an undisclosed foot injury.
Cruz won a close and very technical match by split decision. Many analysts had Dillashaw winning the fight. Several commentators have already called for an immediate rematch. While the last match was fun and had decent buildup, there isn't an need for Cruz and Dillashaw to rematch right away.
Championship rematches have been overdone the last few years.
AWS Elastic Beanstalk simplifies application management, with server scaling out-of-the-box. Scaling is pretty idiot-proof. In fact, if you try to scale down to zero instances, you get the following:
MaxBatchSize: Invalid option value: '0' (Namespace: 'aws:autoscaling:updatepolicy:rollingupdate', OptionName: 'MaxBatchSize'): Value is less than minimum allowed value: 1
A few weeks ago, I was asked to scale an environment down to determine if there was any adverse effect in terminating it. Basically, we would scale down to zero and see if anyone missed it being alive. In order to do this, we had to go around Elastic Beanstalk and using the Auto Scaling Group:
In the AWS Console, go to Compute -> EC2
In EC2 Dashboard, go to AUTO SCALING -> Auto Scaling Groups
Use the Filter text box to find the auto scaling group for my environment. Typing in the environment name (e.g. stag-rails-app-s1) should work.
I ran into an issue is week where our NW.js desktop application keep running into the same issue, even after a refresh reinstall. The user had this application installed on their local machine before. The answer was that we also need to delete the local app data, store in:
For Mac OS X, ~/Library/Application\ Support/SOME_NW_APP
For Windows 8, C:\Users\%USERNAME%\AppData\Local\Chromium\User Data\Default
Brian "T-City" Ortega is showing how jiu-jitsu should be used in MMA. Training out of the Gracie Jiu-Jitsu academy in Torrance, California, Ortega is a black belt under Rener and Ryron Gracie.
At UFC 195, Ortega faced Diego Brandao, a fellow jiu-jitsu black belt and an Ultimate Fighter Champion. Down 20-18 after two rounds, Ortega needed a finish. Starting in front headlock position, Ortega chained a beautiful set of transitions together: d'arce choke, to mount, to triangle.
I attempted to deploy my Rails app to AWS OpsWorks and get the following error:
[2016-01-01T08:39:36+00:00] ERROR: Running exception handlers
[2016-01-01T08:39:36+00:00] ERROR: Exception handlers complete
[2016-01-01T08:39:36+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out
[2016-01-01T08:39:36+00:00] ERROR: deploy[/srv/www/myapp] (deploy::rails line 65) had an error: Chef::Exceptions::Exec: if [ -f Gemfile ]; then echo 'OpsWorks: Gemfile found - running migration with bundle exec' && /usr/local/bin/bundle exec /usr/local/bin/rake db:migrate; else echo 'OpsWorks: no Gemfile - running plain migrations' && /usr/local/bin/rake db:migrate; fi returned 1, expected 0
[2016-01-01T08:39:36+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
OpsWorks doesn’t give the best logging from the AWS Console. All we know from this is that the deployment failed on the following line:
if [ -f Gemfile ]; then echo 'OpsWorks: Gemfile found - running migration with bundle exec' && /usr/local/bin/bundle exec /usr/local/bin/rake db:migrate; else echo 'OpsWorks: no Gemfile - running plain migrations' && /usr/local/bin/rake db:migrate; fi
This means that it failed during a migration, but several possible issues could have caused that call to fail. As John C. Bland suggests, the best option to SSH into the EC2 instance and get the stacktrace.
The birth of any startup begins with a dream. Then they need a website. The goal for this post is to describe how to quickly create a website.
I often see companies use drag-and-drop platforms (like Wix and Weebly) or contract out developers to create a Wordpress website. While they may meet certain needs, these platforms have limitations and may fail meet business needs as a company grows. To make a custom changes, developers often have to work around the framework and hack domain-specific features. Since these platforms are made to be generic and for quick development, performance is often sacrificed and maintenance is more difficult. A company contracts out to have one of these sites built and is left owning a codebase that they cannot maintain themselves.
As a developer, I want to make my life and lives of my company or client easier. To do this, we’ll use Refinery CMS. Refinery is a content management system written for Ruby on Rails. Refinery CMS will allow the user to easily and quickly change content on the site. Since it is using Rails, it does not get in the way of future coding development.
Rails is a well-established web framework, with many libraries written for it. I’ve been doing Ruby and Rails work professionally for several years. Relative to other technologies, it is easy to learn. And the large community makes it an easy skill to hire for, if the business grows.
Refinery also has a very active community. Many common issues can be found through Github, StackOverflow and Google. And the code updated very often. Refinery is built as an engine, which means it can be integrated into an existing Rails website. It also allows the developer to do things the “Rails way”, so no invasive hacks or workarounds are needs to add custom features. There are also many useful extensions. One that I will be using is refinerycms-blog.
Besides functionality, we also want to make a presentable user interface. To save development time, we will use Bootstrap. Bootstrap is a front-end framework (HTML, CSS and JS) developed at Twitter, then open-sourced. It codifies many of the best front-end practices and styles. This allows developers to create presentable websites quickly. For better or worse, it is also why many of today’s website look the same.
While setting up refinerycms recently, I kept running into the following error:
speakingurl-rails.rb:8:in `block in <class:Railtie>': undefined method `prepend_path' for nil:NilClass (NoMethodError)
This happened both when creating a new application and integrating refinerycms into an existing application. It occurred when running rails generate refinery:cms and other rake tasks like rake db:migrate. After some searching, I came across this explanation.
What happened was the latest version of sprocket-rails has be published in rubygems. speakingurl-rails, which is dependency for slug support, has not yet been updated to support the new sprocket-rails gem. To resolve this, I had to: