Mendix On AWS

Provisioning a Mendix server instance on AWS EC2 we will use the base Amazon AMI image (flavor of CentOS).

Launch AWS EC2 Instance

$ sudo yum update

Installing Mendix Server/Tools on CentOS

Add additional repo location mendix.repo

$ sudo vi /etc/yum.repos.d/example.repo

[mendix]
name=Mendix
baseurl=”https://packages.mendix.com/platform/rpm/”
gpgcheck=0

$ sudo yum install m2ee-tools

Oracle Java JRE 8

JRE 8 is required for Mendix 6 and above. Below is the commands to grab linux-x64. Reference the link below to the Oracle downloads page for latest version.

sudo su

$ cd ~/

$ wget –no-cookies –no-check-certificate –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” \ “http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jre-8u151-linux-x64.rpm”

Perform localinstall

$ sudo yum localinstall jre-8u151-linux-x64.rpm

Citation: https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Python Requirements

Check version

$ sudo su

# python --version
# pip install httplib2
Confirm
# pip list

Examples of m2ee config files are located at: /usr/share/doc/m2ee-tools-0.5.11.4/examples

Deployment Location

It’s highly recommended to create a separate user per mendix application you want to run on the application server. adduser example on m2ee-tools documentation does not have the same flags. –disabled-password and –gecos citation: https://github.com/mendix/m2ee-tools/blob/develop/doc/install-2.md

$ sudo adduser myfirstappz

Create filesystem location for the Mendix app

$ sudo mkdir -p /srv/mendix/myfirstappz
$ cd /srv/mendix/myfirstappz
$ sudo mkdir runtimes/ web/ model/ data/ data/database/ data/files/ data/model-upload/ data/tmp/
$ sudo chown myfirstappz:myfirstappz * -R
$ sudo chmod 700 model/ data/
$ sudo tree

AWS issue, this file structure methodology will not scale, need to consider other options on how to redeploy this in a stateless matter.

Configuring The Application

Going through the documentation on m2ee-tools, notes below. Note: might have to login as the app user (myapp) or root due to permissions https://github.com/mendix/m2ee-tools/blob/develop/doc/configure.md

Copy & Configure m2ee.yaml

$ cd /usr/share/doc/m2ee-tools-0.5.11.4/examples
$ mkdir ~/.m2ee
$ cp user-specific-m2ee.yaml ~/.m2ee/m2ee.yaml
$ sudo vi ~/.m2ee/m2ee.yaml

Config for m2ee goes in: ~/.m2ee/m2ee.yaml

Configuring NGINX

example config provided, lacks setting up nginix for this scenario.
https://github.com/mendix/m2ee-tools/blob/develop/doc/nginx.md

aws ubuntu example:
https://www.nginx.com/blog/setting-up-nginx/

$ sudo yum update
$ sudo yum install -y nginx
$ sudo service nginx start

example: http://ec2-34-212-160-182.us-west-2.compute.amazonaws.com/

configure nginx for myfirstappz

$ sudo vi /etc/nginx/nginx.conf

Set the Server->root to /srv/mendix/myfirstappz/web/

$ sudo nginx -s reload

Deploy Mendix App

Example MDA file on s3: https://s3-us-west-2.amazonaws.com/agents.exprealty.com/mda/mendixtest.mda

project location:

$ su myfirstappz myfirstappz@ip $ cd /srv/mendix/myfirstappz/data/model-upload
myfirstappz@ip $ wget https://s3-us-west-2.amazonaws.com/agents.exprealty.com/mda/mendixtest.mda

Launch m2ee and unpack the mda file

myfirstappz@ip $ m2ee
unpack mendixtext.mda

Run Mendix App For First Time

$ su myfirstappz
myfirstappz@ip $ m2ee
download_runtime
start

Read More

Logo Concept: Code Sleep Shred

I figured that I’d publish this now. As you can tell, the blog is running the stock TwentyTen theme, which is great. I am not focusing on design right now, merely content! Below is the Code Sleep Shred logo content I brewed up in my mind.

This design is intended for t-shirts, which will eventually segway to buttons / stickers. Although, the swag would only be for personal promotion, I hope a few readers will indulge.

The Concept

Code, Sleep, Shred defines who I am. By day I code away at WordPress projects. By night I am tinkering with the latest distro’s on my servers or locally on uBuntu. Next thing you know, I’m shredding epic powder at local mountains. Note: the wildcard at the end of ./shred* – not only does shred represent my passionate obsession for snowboarding, it’s also an analogy for other types of shredding; shred on my skateboard, shred tires, shred papers, shred babies, etc.

The goal of CodeSleepShred.com is to present who I am. Regardless of my interests or who the reader is and why they ended up on my blog. If they find it resourceful under the #nerdcore categories, great! Although one might enjoy my personal interests.

Thank you for your time, and I hope you discover useful information from this blog.

Read More

Will The Next Macbook Air Have The Intel Ivy Bridge Processor?

With Intel’s latest announcement of 22nm 3-D transistors, the Ivy Bridge processor has been the talk of the blogosphere. In late 2010, the latest generation of Macbook Air released but never received an i-series chip. This June, what will be announced at Apple World Wide Developers Conference? We can speculate the new iPhone 5, or more realistically the iPhone 4G. Will Apple announce the next generation Macbook Air which utilizes an i-series chip? 32nm, 28nm, or 22nm technology? Will it be Sandy Bridge or Ivy Bridge?

One thing is for sure, I’ve been eyeballing this laptop for the past month. I think I will wait until June for any big announcement. I’d love to have the opportunity to load uBuntu 11.04 onto it for testing purposes. I’ll be camping at the local Mac store to get a hold of it!

Read More

De-laminating / Cracked DC MLF Snowboard

I’m very sad from this weekends epic adventures up at Mt. Baker Ski Resort. I came back with a cracked / de-laminating snowboard. I’ve only had this snowboard for 3 months and it is in pristine condition. There is only one ding in the edge, which was my fault. The actual de-laminating spot is near the binding is where a skiers edge cut the top layer and a little bit of the sidewall. I noticed there was a burr, so I removed it. I was mainly worried that the top layer would start pealing back. I noticed a crack on the top layer Sunday afternoon which spanned about 70% width of the board. I quickly jumped out of my bindings to inspect the crack. It seems to have spidered from that spot where the ding originally was and begun de-laminated. The resin layer in between the sidewall / core and the top layer is flaking. I figured I’d start looking into warranty options, but I have a feeling it might not be honored.

Looking at the DC Snow Policy page, there is no mention about snowboard warranties and the process to have them inspected. I shot warranty (at) dcshoes.com an e-mail, so I hope to hear back from them soon. I noticed the company also lists authorized DC dealers, so I looked at my local options here in Bellingham. I immediately shot off a few e-mails, made a few calls and even walked into Zumiez to see if they could contact a DC Shoes rep. Unfortunately, the main manager at Zumiez said a few other customers have been having issues contacting DC for warranties. He said to check out DC’s website and contacting them directly. I contacted The House about contact information for a local DC rep with no response back. I’m starting to worry DC Snow might be a little to small to provide good customer service.

I might be in luck though, after the disappointing news from Zumiez I decided to make a few more calls to local shops near Seattle. Michael from Grass Roots Outdoors said I should bring in the board and he could call DC in California directly. I’m planning on zipping down to Everett Tuesday to send off my board immediately.

A lot of people question the quality of DC Snowboards since they’re a fairly new snowboard company. I’m really hoping that this incident doesn’t effect my opinion on DC Snowboards. Over the years, the DC Snow division has been perfecting their snowboard technology by working with their pro team. In all honesty, the DC MLF Snowboard is a great freestyle board and I would recommend their boards to others. Hopefully my next buy tops the 2009 DC MLF Snowboard.

Read More

Testing mail() On Apache

Updated March 2017: fixed the code to display from gist snippet.

Here is a simple way of testing if your mail() function is working. I’ve used this script to test if the mail servers are properly working. From time to time I’m asked to migrate websites to new DNS’s. When I’m setting up the MX Records, I need to test to make sure the server sends / receives e-mails.

To test outgoing mail using PHP’s mail() function, simply create testmail.php and use this:

Very straight forward, set $to variable to your own e-mail. Edit the $subject and $body if needed. The if conditional will e-mail you if the mail() function exists! Otherwise, you get fail. 🙁

Read More