Doug Jaworski

Working on New Site

I have been away from this site the past year extremly busy with work. I do anticipate rolling out a new version with updated content within the next 2 months so comeback from time to time or follow me on twitter for more updates.

Ruby Development Platform on OS X Lion

Many of you that know me, know that I have signifigantly more experiance with systems then I do programming languages. The extent of my programming languages is usually limited to systems related programing at the shell with Bash, Perl, etc. Over the past few years, I have been interacting more with Ruby, both as a web development language and systems scripts with the use of Opscode Chef.

For those that don’t know what RVM is, it is the Ruby Version Manager. After interacting with Ruby, you will inevitably find yourself gravitating to it so you do not comprimise the systems version of Ruby. I like how RVM lets you setup custom gemsets and run multipe versions of Ruby all within the user space. I find this most usefull when experimenting with newer features and testing various gem packages.

So, know to the reason for this post. I have found it extremly frustrating getting the right enviornment setup across all my systems with the recent OS upgrades and various versions of Xcode, so I decided to share my proven method. This is a dead simple guide on how to get a pristine ruby enviornment running flawlessly on a clean install of OS X Lion.

Xcode 4.2.3

You actually might be able to get away with this however there are just a few ruby applications that I have that are compiled with specific Xcode tools. I find it easier to just install it and all its features even though I do not work with Xcode very often.

OS GCC Compiler

OSX GCC Compiler is the most important and that contains all the necesary compilers that eliminate the need to install Xcode if you need a basic GCC compiler. Simply download and install. I also find it necesary to add this to your bash_profile in order for your code to use the right C compiler.

1
export CC=/usr/bin/gcc-4.2

Homebrew

What would my life be without Homebrew. Well, honestly no different but i find it invaluable replacement of MacPorts and is probably the most up to date collection of Unix/Linux/BSD tools for the Mac platform. Now, you can get away from using this but I highly recomend it. If you ever find yourself needing the lastest NMAP, simply run

1
brew install nmap

Ruby Version Manager

Ruby Version Manager or RVM is a dead simple way to work with Ruby on all nix or BSD based systems. The install is very straight forward and can be completed in just a few steps on the command line.

For more information on how to install RVM, check out my earlier post titled How to Install RVM

There you have it. With these sets of tools, you can plot to take over the world or build the next great internet startup.

How to Install RVM

RVM or Ruby Version Manager allows you to run multiple instances of Ruby within your user space. No need for root or admin privileges with RVM. I stayed away from RVM for sometime, only because I thought working with the systems version of Ruby was enough for me. As I got more involved with Ruby scripting and programming, I found myself needing a more robust installation that did not conflict with the systems version.

These steps are taken from RVM website.

Install RVM

They setup a nice script that you can get directly from GitHub. Run the following from your shell prompt.

1
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Setup Your Shell

1
rvm install 1.9.2
1
rvm use 1.9.2

Updated Rubygems

1
rvm rubygems latest

That is about it.

Ferrari Pile-Up

14 Luxury sports cars are wreked in route to auto show in Hiroshima. I am not sure why they would not just trailier these things vs. taking the risk of driving them.

My Personal Strugle With Hearing Loss

What? Can you repeat that? Lukas, I did not hear what you said, can you come closer? This is my new way of life.

I have had some form hearing loss for most of my life and I just adapted to it as a nuisance. I first noticed it in high school when I got to the age I was using the phone more. It only impacted my right ear and I just adapted to it by changing my behavior. Never really thought much of it and never had any tests performed to identify the the reason or search for a cure. It was really not a big deal and did not think about it. At times even had its advantages.

Fast forward almost 20 years..

I started experiencing more hearing issues back in late 2009. Enough so, that it prompted me to go to an ENT. I was having extreme difficulty hearing out of what I considered my good ear and just thought it was clogged up or that I had a slight ear infection. I was experiencing a very loud and disruptive ringing that was driving me insane called tinnitus. More on tinnitus later. I tried the normal things such as antibiotics, steroids, time, and nothing worked. I had brain scans and extensive hearing tests to look for any possible causes such as tumors. The ENT and Audiologist just said I had an unusual form of hear loss and recommended that I get hearing aids as that would possibly help with the tinnitus.

So, I got my first pair of hearing aids. Almost $6000 worth of tiny electronics that it on the top of my ears and a plastic ear mold that fitted to my ears. I called them, my robot ears and it was a fun conversation piece with my son for awhile. Learning to hear with hearing aids can be challenging. I did not realize how bad my hearing was until I put them in for the first time. It took me about a week to adapt to the unusual noises that I had never heard. Everything from my soft footsteps, the tinging sound of water as it dripped out of a faucet and the clicking sound one makes when typing on the keyboard. That and the reverberation of my voice were probably the most difficult to adjust to but over time, but it soon just became normal.

Well, a few months past. Around the spring time if I recall correctly. I was able to hear again in my left ear. I was hearing well enough that I stopped wearing the hearing aids daily. Days turned to weeks, then months. I was thinking to myself, what a waste of $6000.

Fast forward to spring of 2011..

What do you know? My hearing started to go again. So I started wearing my hearing aids again and went to a new ENT. We again tried the steroids, antibiotics and decongestants. Nothing worked. What was more frustrating was the pressure I had in my hears. I had just taken a flight and I had some slight sinus pressure buildup due to a head cold I had at the time. The pain I felt when the plane started to descend was of one I will never forget and I do not want to experience again. So, back to the ENT, he recommended ear tubes. I liked the idea because I felt that would relieve my ear pressure and I was flying in the next few days to Houston. He was able to get me in literally the next day at a local surgical clinic. A 38 year old grown man going in for what a 2 year old gets to relieve ear infections. Even the nurses at the surgical facility expected a 2 year old.

It took about a day after the surgery and i could hear once again. The ear pressure was gone and I did not need the hearing aids anymore. Though, everyone sounded a bit funny the first few days. Almost like robots.

Went to Houston for a few days and on my last day, exactly 1 week after the surgery I once again began having hearing issues and the tinnitus was back, louder then ever. I thought to myself, not again!

Fast forward 2 weeks, the Friday before the 4th of July..

My hearing was troubling me more then ever and impacting my sleeping patterns, more so the tinnitus. So, I would frequently get up at night and would stumble a bit. I really did not think much of the stumbling and I just thought it was due to lack of sleep and walking around in the dark or getting up to quickly.

It was now Friday, July 1st. The family and I had no real plans this weekend other then having the in laws over for a BBQ. I worked from home at the time and cut out around 5pm. I felt a bit funny, an occasional loss of balance but did not think much of it. Made it down stairs to the kitchen and started feeling dizzy and nauseous so I decided to law down on the sofa. This is when my world changed on me. I began feeling beyond dizzy with literally everything spinning and this took me to the floor. It was the feeling that i was on the tea cup ride at Disney just to long and it would not stop. Extreme vertigo kicked in.

My sister in law just happened to be over at the house. Not sure why she was there, she just was and the wife and kids had run an errand or something. She saw me on the floor and I am not quite sure what lead up to it but the next thing I know there was a police officer at the house then followed up with EMT. The vomiting began! I vomitted so much I was vommiting nothing after a few hours. Vomiting nothing up is worse then vommiting everything up. I ended up going to the hospital and spending the evening and all of Saturday there. Was prodded, poked and given high doses of anti-nausea medication and high doses of steriods. All this while spinning.

My ENT came to the visit me on Saturday morning in the hospital and after reviewing everything concluded I had Menier’s Disease. Meniere’s Disease is a disorder of the inner ear that can affect hearing and balance to a varying degree. It is characterized by episodes of veritgo and tinnitus and progressive hearing loss. Well, that is not good, but I did have an explanation for what was going on. I went home later that Saturday. Ears felt very full, a hard feeling to explain. Almost like there is water in my ears and I could once again could hear without any assistance from my hearing aids.

Meniere’s Disease is a disorder of teh inner ear that can affect hearing and balance to a varying degree. It is characterized by episodes of veritgo and tinnitus and progressive hearing loss.

I was told to adjust my salt intake. Basically reduce and eliminate as much salt as I can possibly stand and stop drinking any stimulants that contain alcohol or caffeine. You have no idea how difficult the caffeine part was as I lived on 6 cans of Coke daily, sometimes more.

Fast forward to August. We moved to Houston Texas from Schererville Indiana. Yes, that is another story. I had talked to my ENT about my move to Houston and he recommended that I pay a visit to Baylor at the Med Center. Houston is an amazing place with an entire portion of the city dedicated to the medical profession. So, before I moved, I scheduled an appointment. Again, right after I got to Texas, my hearing went south on me. Was not initially experiencing any vertigo but I did not feel right. My new doctor, a neurologist and researching had me on high doses of steroids and it worked for about a day. We then tried steroid injections and had an MRI. Still nothing. He was basically looking for what was causing this. After the blood work, MRI and the results of the steroids, he ruled out Autoimmune Disease and classified it as Menier’s Disease. Well, that was sort of a relief but the bad news is that I have established a new lower level baseline of hearing loss and I am now fully dependent on hearing aids.

Over the past few weeks I have learned to adapt to both the tinnitus and hearing loss and Vertigo. Mostly adjustments to my diet, medication and the knowledge of what is wrong with me. The people I work with and my family understand some of the hearing difficulties I have. I have been fortunate that I do have the capability of hearing others while wearing my hearing aids and when in direct face to face contact with them, but put me in a loud room or a noisy situation it is nearly impossible to understand people. I have also started using a high powered ear piece that I use for when on the phone at the office.

I still continue to look for better solutions to managing my situation. I still dont know a whole lot about Menier’s Disease and I live in fear of a Vertigo attach at any time. I have to take Melatonin to help with the sleep and that seems to be doing the trick for now. More to come I am sure…..

WII Console Won’t Turn On

Came home home today with the wife and kids complaining that the WII console wont turn on. This is a big deal since there is no school on Wednesday. A little trick I came across at the Nintendo site is unplugging the power adapter for 2 minutes. This basically resets the AC adapter, much like that of resetting a circuit breaker. Also just to be safe, unplug everything directly connected to the WII. After 2 minutes, plug everything back in and you should be good to go!

My Octopress Workflow

I work from multiple workstations at various locations and I am very dependent on Git to keep order out of everything. I dont really do any collaborative work since I am mostly learning. Since I recently started working with Octopress, I needed a clean workflow to post and publish posts. This is in short what I do.

Initial Setup

The intial setup for Octopress is right out of the installation documentation. The one item to note, while working with Octopress for this first time it was my first hands on experiance with RVM and now I am a convert. I also followed the guide on Using Octopress With Heroku.

Basic Workflow

Now that I have the site up and running on Heroku, I want to be able to work from multiple locations. This is where Git comes back into the picture. I simply run the following.

Clone my App Repository

1
git clone -o heroku git@heroku.com:my-app.git

This clones the repo and sets my origin to heroku and now I can update as I see fit.

1
2
3
4
rake generate #basic build
git add . #adds updates to local git
git commit -m 'site update' #commits changes to local git
git push heroku master #updates remote git and deploys site

Run You Own Git Server

I was originally introduced toGit will working with Puppet and Chef configurations. After having leveraged other CMS in the past such as CVS and SVN, I simply found Git easier and more enjoyable to use.

While I don’t code per se, I treat all my configurations as code and revision them as such. It ties in nice with working across multiple systems while enabling me to take my work with me even when it is not truly with me. While I still do have and and use a GitHub account, I often find myself in situations in which I don’t want to publish my content to GitHub. For this, I run my own Git Server. This HowTo is only to show you how to setup a Git Server. There are plenty of great tutorials already out there that help explain the details of Git.

These are just a few links to some great tutorials on Git.

Setup Git
Create a Repo
Fork a Repo
Git Cheat Sheet

The real secret sauce to Git in my opinion, is its use of SSH Keys for authentication. While you can use a password, it does not work well with multi-user setups. Key’s are easy to manage and revoke, allowing for a central authority of remote access.

1. Install Git

1
apt-get install git-core

If you are on MAC OS X and have xCode installed you already have the core functionality required to follow along.

2. Create a GIT User

If you are familiar with SSH Keys, this will seem rather simple however if you have not used SSH Keys for password less authentication, I recommend you read this for further understanding. The actual creating of a “Git” user is completly optionial as you can use your existing user. The purpose for creating a standalone user is that you can share this with multiple individuals.

1
adduser git

3. Create SSH Keys for the Git User

As the newly created git user, run the following commands.

1
2
3
mkdir ~/.ssh
chmod 0700 ~/.ssh
ssh-keygen -t rsa -b 4096

Accept all the defaults and hit enter for the passphrase. We want the passphrase to be blank. These commands setup your SSH directory for Git as well as installs a secure RSA key.

4. Create Client SSH Keys

On the client

If you do not already have an .ssh directory or any SSH keys, we will go ahead and set them up. If you do have keys, skip this step and go down to Step 5.

1
2
3
mkdir ~/.ssh
chmod 0700 ~/.ssh
ssh-keygen -t rsa -b 4096

You then have to get copy your id_rsa.pub contents to the user Git on the server to a file called ~/.ssh/authorized_keys. There are many ways to get this key on the server however for this tutorial, we will just use the good old copy/paste method.

5. Copy CLient SSH Keys to Server

On the client

1
cat ~/.ssh/id_rsa.pub

Copy to the clipboard

Server

1
2
3
touch ~/.ssh/authorized_keys
chmod 0600 ~/.ssh/authorized_keys
vi ~/.ssh/authorized_keys

Paste from clipboard and save.

From the client as the user who you want to grant access to.

6. Create Empty Git Repository

On the server (as the git user) run the following command.

1
git init --bare test.git

7. Clone Repository to Client

1
2
3
git clone git@localhost:test.git
Initialized empty Git repository in /home/doug/test/.git/
warning: You appear to have cloned an empty repository.

This created a directory called testing on your local client.

8. Setup Git Global Variables

Run the following commands.

1
2
git config --global user.name "Your Name"
git config --global user.email you@example.com

9. Commit Changes

1
2
3
4
5
cd ~/test
touch README
git add .
git commit –m “first commit”
git push –u origin master

If all is successful, you should have something like this.

1
2
3
4
5
6
7
git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 226 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@localhost:test.git
* [new branch] master @ master
Branch master set up to track remote branch master from origin.

Amazon Route 53 With Cli53

I am running all my personal domains now on Route53. Figured, why bother with the complexity and overhead of running my onw DNS servers when I can use a programatic DNS server that allows me to update records within applications leveraging a robust API. Up untill about 2 weeks ago, you were completly limited to Amazon’s API and 3rd party wrapers. The one I chose to work with cli53 as it was straight forward and for the most part followed the README and was up and running in minutes.

1. Install Boto Boto is a python interface to Amazaon Web Services.

1
apt-get install python-boto

2. Create a Boto Confif File The boto config stores your amazon credentials, so keep this secure. As an alternitive, you could set these as enviornment variables.

1
2
3
[Credentials]
aws_access_key_id =
aws_secret_access_key =

3. Install cli53 I like to keep my Amazon applications in one easy place. To make it systemwide, I use /usr/local/ec2.

1
2
3
4
5
6
7
mkdir /usr/local/ec2
cd /usr/local/ec2
git clone git://github.com/barnybug/cli53.git
cd cli53
python bootstrap.py
bin/buildout
ln –s /usr/local/ec2/cli53/bin/cli53 /usr/local/bin/cli53

The last step creates a symbolic link to /usr/local/bin and that should already be in your path. To test it out and make sure it works, simply run

1
cli53 list

This will show a listing of all your zones. Since this is your first time, it should come back empty.

4. Create Zones and Records Now lets create our first record. For this we will use example.com

Create the zone

1
cli53 create example.com

Create a record

1
cli53 rrcreate example.com www CNAME  ec2-174-129-252-150.compute-1.amazonaws.com

Delete a record

1
cli53 rrdelete example.com www

It is as simple as that. I will work up a MAC friendly version of this tutorial in the near future.

Moved to Heroku

Today I moved my domians from Amazon to Heroku. Partly because I am cheap and like the free hosting that Heroku provides but also because my needs have changed and I wanted to try something new. Over the past 11 years, I have moved from dedicated hardware in my then San Franscisco loft, to colocated hardware in East Bay data centers. Later transitioned to several VPS solutions and then to Amazon Cloud. I have been very happy with the Amazon Web Services however I no longer need a true shell enviornment as I have that locally. As I learn more about Heroku I will post updates here.