Wednesday, December 17, 2014

VMware Player Free and changing boot devices.

VMWare player free doesn't include all the settings that the commercial editions offer. In order to boot an iso, you must hand edit the *.vmx file and add the following settings.

bios.bootOrder = "cdrom,hdd,floppy"
bios.hddOrder = "scsi0:0,ide1:0"

Adding the above information allowed me to install fedora 21 over my existing fedora 20.

Tip: After installation, I powered the vm off. Removed the above lines and removed the fedora iso from the vmware cd drive.

Monday, September 1, 2014

Using Chef to auto create an instance on Amazon ec2

Chef is one of the major server automation tools out there along with Puppet and Ansible. I decided to give chef a try by auto creating an ec2 instance. They're all trying to get you to buy saas packages for nodes greater than around 5. I will be using the free account offered by opscode to store my recipes.

1) Create a new chef-repo or use your current chef-repo


For testing I cloned a new chef-repo
git clone git://github.com/opscode/chef-repo.git ec2chefrepo

2) From the previous tutorial ./chef-repo copy over ./chef-repo/.chef into our new chef-repo


3) In Amazon Ec2 click on your name in the top right


I get a password old/new page. Instead go to the left side and click on Users.

Then click on your email and then the security credential tab

4) Get the Access Keys and Secret Keys


Click on Manage Access Keys
Create a new key and you will get two strings.
Note: The secret key is show and available this one time. You will need to create new access keys if the secret key is lost.

Access Key Id
AKAJG6Z4AFQ5YPQ

Secret Access Key
Mw5sHvDgJRtAVP2vkA8gL8XJkvoZijhNMf

5) With the above access keys and your ec2 .pem add these lines to ec2chefrepo/.chef/knife.rb


knife[:aws_access_key_id] = 'AKAJG6Z4AFQ5YPQ'
knife[:aws_ssh_key_id] = 'bunwichchef'
knife[:aws_secret_access_key] = 'Mw5sHvDgJRtAVP2vkA8gL8XJkvoZijhNMf' 


Note: the ssh_key_id is your key name without the pem

6) Create a gemfile to install some gems


gem install bundle
rbenv rehash
cd ~/ec2chefrepo/
vim Gemfile

source 'https://rubygems.org'
gem 'chef'
gem 'knife-ec2'


Note: I had to run this before running bundle installs
sudo yum install gcc-c++

bundle install

7) Create and Deploy An Instance


Had to run:
gem install rb-readline unf
http://aws.amazon.com/amazon-linux-ami/
To get a list of AMI Image Ids

knife ec2 server create \
  --availability-zone us-east-1b \
  --node-name bunwichchefinstance.demo \
  --flavor t1.micro \
  --image ami-ba18d2 \
  --run-list "role[memcached]" \
  --identity-file ~/.ssh/bunwichchef.pem \
  --ssh-user ec2-user 






Sunday, June 15, 2014

vlc no decoder module fedora 20

Sometime after updating Fedora 19 to 20 (using fedup), VLC stopped playing some h264 videos.

An error message such as this appeared:

no suitable decoder module for fourcc `h264'. VLC probably does not support this sound or video format.


No suitable decoder module:
VLC does not support the audio or video format "h264". Unfortunately there is no way for you to fix this.

It was missing lame-libs. A sudo yum install lame-libs solved my issue.

What is more important is how I solved this:

a) vlc -vvv mediafile.mp4

b) Look for yellow or red warning/error messages. A lot of information gets outputted.

eg:
0x1666118] main libvlc warning: cannot load module `/usr/lib64/vlc/plugins/demux/libavformat_plugin.so' (libmp3lame.so.0: cannot open shared object file: No such file or directory)

c) This message states that libmp3lame.so.0 does not exist.

d) sudo repoquery --whatprovides '*/libmp3lame.so.0'

returned:
lame-libs-0:3.99.5-2.fc19.i686

Friday, May 30, 2014

Failed to load libGL.so on Fedora 20 and Android emulator

I got this warning when trying to get the android emulator working on Fedora 20.

You need to install 2 packages to get this working:

sudo yum install mesa-libGL-devel mesa-libGL-devel.i686

The libGL.so message disappeared after this. Command to search for this lib on future installs.

sudo yum whatprovides */libGL.so

Thursday, May 1, 2014

How humor and software development are related.

I've been putting out a few resumes and getting back to an HR person with my status. Part of my response describes how having a funny bone has affected me as a developer.

Hi XXX,

Hope your talent search is going well for XXX. We had a short but good talk last week and went over my qualifications and past work experience. I enjoyed listening to what you and XXX were looking for in prospective employees. I did my best to be as cool as possible, but having our call dropped and me running around the all corners of my building trying to find a good connection, might have made me sound a little nervous :)

My three main takeaways from our call was that culture, personality and technology skills were equally valued by XXX.

Coming from a small town, I feel that I was able to grow up in an environment where being good to your neighbours and having great friends were an important part of life. People still left their doors unlocked and when you drive by in a car you wave your hand. I think I certainly have brought this attitude with me as a Vancouverite, and will wave to my neighbours when I bike or walk around my part of town. I stopped doing this downtown as people looked at me strange (except in downtown east side where they tried to hug me...ewww)

Having not a lot to do in a small town also made you grow your personality and one aspect is that I think I have a great sense of humour and wit. All you have are your friends and when there wasn't much to do we would sit around and make jokes. It was a game of one upmanship, when someone said something funny, you tried your best to build on it or say something even funnier. It's important to note that humour can sometimes hurt people, and being careful not to cross that line is part of the fun. I tend to respect Stephen Colbert's type of humour, and know I'll never be as good. People have told me that I'm funny, but I always tell them, "Really? I'm the least funny person among my funny group of friends".

This trait has helped me make friends and interact with people, but I think it also has helped my career. Rule of comedy - funny comes in threes. You tend to look at a situation or a phrase and think of three things that you can add to it. It really helps with improving your lateral thinking and I find that I apply this to all aspects of my every day work. During a conversation or a question, I come up a set of options, and try to mentally travel down each path and drop the ones that don't work. Then express the good ones. Keep repeating until the best solution is found. This is what developers do all day I feel that it is one of my strongest attributes that one would expect from someone who was more artsy.

...

A large part of software development is analyzing a situation and choosing an option and testing the results. Comedy is analyzing a situation, finding the absurdity and testing among your peers. Nothing is funnier than seeing your TDD tests pasts, am I right? Is it no wonder that some great comedians had STEM backgrounds?

Jimmy Fallon - CPSC (yes he dropped out for SNL)
Mike Judge - Physics
Rowan Atkinson - EEng
Ray Romano - Accounting

Wednesday, February 12, 2014

Finally a MySQL connector that works with Django and Python 3

The django community isn't the most supportive of mysql. They have valid arguments on why postgres is superior is to mysql and I don't disagree with them. Except that I have a level of comfort with MySQL that I've gotten from being paid to work with it the past six years. I'm not necessarily forgiving MySQL for its quirks, but I know I can depend on the large community and the vast resources if I ever run into problems. On the chance that one of my projects 'hockey sticks', there are experts who have gotten MySQL to scale with the traffic.

For those that are techno puritans, they sometimes forget that MariaDB is a solid open initiative that deserves support from the community as it adheres to the same open source principles as Postgres.

I've been patiently creating my app in Python 2.7 eagerly waiting for one of the MySQL connectors to work with Python 3 and Django. Finally in the past month MySQL released an official one.

I tested this connector with the Django tutorial app and got ./manage.py syncdb to create some tables for my test models. More testing will be needed to see if south and other parts of the Django ORM are working correctly.

http://dev.mysql.com/doc/connector-python/en/connector-python-django-backend.html

System:
Fedora 20
Django
Python 3.3

Step 1:
sudo yum install python-virtualenv

Step 2 - Create your python 3 environment:
virtualenv -p /usr/bin/python3 myenv

# On fedora python 3 is sym linked to python3.3

cd myenv
source bin/activate

Step 3 - Install Django and the official mysql connector:
pip install django # at the time of this writing it is 1.6.2.
pip install mysql-connector-python

# This matches the connector version from the mysql link above.
# Downloading mysql-connector-python-1.1.5.zip (337kB): 337kB downloaded

Step 4 - Configure Django settings.py to use this database connector:

DATABASES = {
    'default': {
        'NAME': 'mydatabase',
        'ENGINE': 'mysql.connector.django',
        'USER': 'myuser',
        'PASSWORD': 'secretpassword',
        'OPTIONS': {
          'autocommit': True,
        },
    }
}


Step 5:
Create your models and run ./manage syncdb

Update: Feb 12, 2014
http://dev.mysql.com/doc/relnotes/connector-python/en/news-1-1-5.html

Changes in MySQL Connector/Python 1.1.5 (2014-01-31)
Functionality Added or Changed
- Connector/Python is now compatible with Django 1.6. (Bug #17857712)

You can find the Fedora 20 rpm from here as 1.1.5 is being tested:
https://dl.fedoraproject.org/pub/fedora/linux/updates/testing/20/x86_64/mysql-connector-python3-1.1.5-1.fc20.noarch.rpm 

I tested with Django 1.6.x