devops: mysql server on azure ubuntu vm

Full disclosure, there are a lot of tutorials for this on the azure website. I just found that every one of them had either enough errors, or enough missing pieces, that it made it impossible to get setup correctly unless you knew what you were doing, so hacked quite a bit of them together.

Go to
Click Virtual Machines > New > From Gallery
(I’m using Ubuntu server 14.04 LTS)

Virtual Machine Name: yourvm
(This will become the address in

New User Name: yourvmusername
(this will be used anytime you need to access the vm)

(you are welcome to handle keys yourself, I’m just going for passwords)

(this will be the password to access the vm)

SET: create new cloud service

CHECK: VM agent


Open Terminal. Connect Via SSH:
ssh -o ServerAliveInterval=180
//You will see the following, enter yes, then your vm password:
The authenticity of host ' (' can't be established.
Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added ',' (RSA) to the list of known hosts.'s password:

Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-43-generic x86_64)
//a bunch of text
//then you'll be at the prompt: yourvmusername@yourvm:~$

Update the VM:
sudo apt-get update
(could take a couple of minutes, bunch of text)
//back to prompt

Install MySQL Server on the VM:
sudo apt-get install mysql-server
//bunch of text
Do you want to continue? [Y/n] Y

UI popup for password for root user on mysql server: yourSQLpw
(this will be how you initially access the mysql server, via un: root, pw: yourSQLpw)
//Confirm it, then back to terminal, lots of text spam, even some things that look like errors or warnings “sent invalidate” and “using unique option prefix” just move on.
//back to prompt

Install MySQL Client on the VM:
sudo apt-get install mysql-client
//bunch of text
//back to prompt

Test if the Service is Running:
sudo service mysql status
//should see: mysql start/running, process etc

Now Open Port 3306 on the VM:
sudo iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

Test that the Port is Open:
sudo netstat -anltp|grep :3306
//you should see something like:
tcp 0 0* LISTEN 3259/mysqld
(3306 in red, that doesn’t mean bad, just that it found that number)

SSH Tunnel from 3307 to 3306:
(Now we create a tunnel on the VM that takes public connections from 3307 and locally sends them to 3306, which is the mysql server)
sudo ssh -fNg -L 3307:
//warnings about authenticity will pop up:
//then you’ll see’s password:
(enter your vm password, NOT your mysql password)
//back to prompt

Go Back to

Setup End Point on the VM:
(this will be the public port 3307 that we add to the VM, which will then hit the SSH Tunnel we made, and route all traffic to the mySql server)
Click on yourvm in the VM tab
Click Endpoints
Click ADD+ button at the bottom of the screen
Name it anything, I named mine 'MySQL Tunnel'
Public Port 3307
Private Port 3307
Don't check any boxes


Now to Connect to the database from Node or PHP, etc, You Use:
Port: 3307
User: root
Password: yourSQLpw

(obviously you can create other user accounts and not use root if you want the edit trail)

To Connect to the VM from CLI:
ssh -o ServerAliveInterval=180
password: yourvmPassword!

Access MySQL Directly from the VM CLI:
mysql -u root -p
password: yourSQLpw

meteor.js: easier default account system files

The account backend in meteor is pretty decent, and is wired up to all the basics, but manipulating the front end is an exercise in frustration, and wiring up the additional features is a headache. The CSS is all wrapped up in compiled files and LASS. So you install one of the packages that removes the styling, but even that makes it a huge pain to change or manipulate the UI. And even then, that UI is tied to some of the basic vanilla behavior and leaves out a lot of the smart and complex features that are available and sometimes necessary.

So instead of making a package that would just be difficult to customize to my needs on projects going forward, I baked all features of the Meteor account system down into 3 files:


By default, all the features are in place, and the UI is styled to match meteor’s home page. As well as being broken into easy to understand templates for all states and use cases…using actual buttons instead of a weird hybrid of hyperlinks and buttons. Every account related feature and function is either wired up in the javascript file, or if it’s a less common feature, then stubbed in with example uses.

Just drop ’em into your project folder, no package installation required.

js: div actions


I made a simple demo framework for animating divs using composite actions for position, scale, and rotation. I was tired of manipulating css for demoing things. I just wanted to instantiate a class, and then call methods on it to animate, much like you would in cocos2d or SpriteKit.

It’s actually a pretty performant little streamlined package. It updates all actions per frame using requestAnimationFrame. It was meant for demoing and presentations, but it could do more.

demo.js contains the examples for how to:

–instance a Thing, which is just a class wrapped around a div.
–add actions to a Thing to move it, rotate it and scale it.
–the top portion has demo flags to force fixed intervals, and lower performance, all just for the purpose of discussion.
–Note: actions are composite, which means if you add 2 movement actions to a Thing, then the thing will be updating each frame based on both actions.

Since everything is just a div, you could add CSS classes and files, use standard button and click and link commands, etc.

For demo purposes the code in the Thing/actions is not very dry, if you were going to really use this to do anything, you’d want to make an action class and create instances of Actions and add them to Things. That way you could also easily pause or remove an individual action ahead of schedule.

Oh, and obviously all the objects have just simple names stored in global, so please wrap them up in something first.