Gotta Get Git

Using .NET, PHP, or Ruby you probably should have your code somewhere nice and safe. These days there is no better place than Github. It is the place to start, maintain, and contribute to software projects or to even run your own private repositories or even setup some private repositories for a business. But enough about Github. In this blog entry I’m going to take a quick tour through getting Git and setting it up for basic use.

For Windows go check out msysgit.

For Ubuntu go check out git site.

For OS-X go check out these downloads.  This link also has information regarding how to setup and use the SSH keys. For Windows that will be extra work, since it doesn’t speak SSH very well. For Ubuntu, the instructions are pretty much exactly the same.

I also had a few tidbits about git in the past here and here. Simple apt-get installation instructions.

Once you have Git installed, there are a few things one should do right away.

A few things, once Git is installed that should be done include setting up your user name and e-mail address for commits. To do this follow these commands.

git config --global user.name "Your Name"
git config --global user.e-mail "blaghDblagh@yourdomain.com"

You can also setup some aliases to commands that you’ll use a lot. I usually setup the following.

git config --global alias.co checkout
git config --global alias.c commit
git config --global alias.p push
git config --global alias.u pull
git config --global alias.a add
git config --global alias.s status

Now that Git is setup and when a web project is ready we can commit and push. Navigate to the root of the folder structure where the project is and issue the initialization and following commands for Git.

git init
git add .gitignore
git commit -m 'Adding the ignore file first.'
git add -A
git commit -m 'Adding all subsequent files and the Ruby on Rails Project itself. In other words, first commit.'
git remote add origin git@github.com:Adron/somewhereOrAnother.git
git push origin master

Note also this .gitignore file included in the overall project. This file is really important to pay attention to before any commits are made to the repository. If it doesn’t exist, and doesn’t have all of the files, directories, and other things that should be ignored, ignoring them after the fact is rather difficult. So make sure it is included and always has everything you want ignored. With Rails Projects this is placed by default, some Visual Studio tools will also add this, and other tools will too. However, it is safe to assume that it is not there and check.

The standard .gitignore included with Rails Projects looks like this.

.bundle
db/*.sqlite3
log/*.log
tmp/**/*

For Rubymine and other exclusions I always add the following, and often times even more. It is easier to take something out and add it later, than it is to remove something after added.

#OS junk files
[Tt]humbs.db
*.DS_Store

#Webstorm & Rubymine files
*.idea
.idea
.idea/

#Rails Heroku and other bits to ignore
*.sqlite3
db/*.sqlite3
public/system/*
.bundle
log/*.log
tmp/**/*
tmp/*
doc/api
doc/app
*.swp
*~
.DS_Store

Well, that’s all I got for now. 🙂 Cheers!

Kicking An Account, Logging Into Windows Server

Yesterday I had to get logged into a Windows Server, however the connections were all consumed already. I had to kick somebody. I’d never done this via the command line, so I pinged a coworker who laid out how to lay low the over-connected users. With two simple commands I was logged in and running!

To see who is logged into a server…

qwinsta -server theServerNameHere

…and then to kick the users by their ID as shown by the query command above…

rwinsta -server theServerNameHere ID#

…and you can now access the server via Remote Desktop Connection. Have fun with your new found connection powers! 🙂

Following Good Practice, The Negative Bits About Windows Azure First, But Gems Included! :D

Ok, I’ve used Windows Azure steadily over the last year and a half.  I’ve fought with the SDK so much that I stopped using it. I decided I’d put together this recap of what has driven me crazy and then put together something about the parts that I really like, the awesome bits, the parts that have the greatest potential with Windows Azure. So hold on to your hats, this may be hard hitting.  😉

First the bad parts.

The Windows Azure SDK

Ok, the SDK has driven me nuts. It has had flat out errors, sealed (bad) code, and is TIGHTLY COUPLED to the development fabric. I’m a professional, I can mock that, I don’t need kindergarten level help running this! If I have a large environment with thousands of prospective nodes (or even just a few dozen instances) the development fabric does nothing to help. I’d rate the SDK’s closed (re: sealed/no interfaces) nature and the development fabric as the number 1 reasons that Windows Azure is the hardest platform to develop for at large scale in Enterprise Environments.

Pricing Competitiveness? Ouch. 🙁

Windows Azure is by far the most expensive cloud platform or infrastructure to use on the market today. AWS comes in, when priced specifically anywhere from 2/3rds the price to 1/6th the price. Rackspace in some circumstances comes in at the crazy low price of 1/8th as much as Windows Azure for similar capabilities. I realize there are certain things that Windows Azure may provide, but my not, and that in some rare circumstances Azure may come in lower – but that is rare. If Windows Azure wants to stay primarily, and only, an Enterprise Offering than this is fine. Nailing Enterprises on expensive things and offering them these SLA myths is exactly what Enterprises want, piece of mind of an SLA, they don’t care about pricing.

But if Windows Azure wants to play in new business, startups especially, mid-size business, or even small enterprises than the pricing needs a fix.  We’re looking at disparities $500 bucks vs. $3500 bucks in other situations. This isn’t exactly feasible as a way to get into cloud computing. Microsoft, unfortunately for them, has to drop this dream of maintaining revenues and profits at the same rate as their OS & Office Sales. Fact is, the market has already turned this sector into a commoditized price.

Speed, Boot Time, Restart, UI Admin Responsiveness

The Silverlight Interface is beautiful, I’ll give it that. But in most browsers aside from IE it gets flaky. Oh wait, no, I’m wrong. It gets flaky in all the browsers. Doh! This may be fixed now, but in my experience and others that I’ve paired with, we’ve watched in Chrome, Opera, Safari, Firefox, and IE when things have happened. This includes the instance spinning as if starting up when it is started, or when it spins and spins, a refresh is done and the instance has completely disappeared!  I’ve refreshed the Silverlight UI before and it just stops responding to communication before (and this wasn’t even on my machine).

The boot time for an instance is absolutely unacceptable for the Internet, for web development, or otherwise. Boot time should be similar to a solid Linux instance. I don’t care what needs to be done, but the instances need cleaned up, the architecture changed, or the OS swapped out if need be. I don’t care what OS the cloud is running on, but my instance should be live for me within 1-2 minutes or LESS. The current performance of Rackspace, Joyent, AWS, and about every single cloud provider out there boots an instance in about 45 seconds, sometimes a minute, but often less. I know there are workarounds, the whole leave it running while you deploy methods, and other such notions, but those don’t always work out. Sometimes you just need the instance up and running and you need it NOW!

Speed needs measurement to prove out in tests. Speed needs to be observed. I need analytics on my speed of the instance I’m choosing. I don’t know if it is pegged, I don’t know if it is idle and not responding. I have no idea in Windows Azure with any easy way. The speed, in general, seems to be really good on Windows Azure. Often times it appears to be better than others even, but rarely can I really prove it. It’s just a gut feeling that it is moving along well.

So, those are the negatives; speed, boot time, admin UI responsiveness, pricing, and the SDK. Now it is time for the wicked awesome cool bits!

Now, The Cool Parts

Lock In With Mort

This topic you’d have to ask me about in person, many people would be offended by this and I mean no offense by it. The reality is many companies will continue to get and hire what they consider to be plug and play replaceable developers – AKA “mort”. This is really bad for developers, but great for Windows Azure. In addition Windows Azure provides an option to lock in. It is by no means the only option – because by nature a cloud platform and services will only lock you in if YOU allow yourself to be. But providing both ways, lock in or not, is a major boost for Windows Azure also. Hopefully, I’ll have a presentation in regards to this in the near future – or at least find a way to write it up so that it doesn’t come off as me being a mean person, because I honestly don’t intend that.

Deploy Anything, To The Platform

Have a platform to work with instead of starting purely at infrastructure is HUGE for most companies. Not all, but most companies would be benefited in a massive way to write to the Azure Platform instead of single instances like EC2. The reason boils down to this, Windows Azure abstracts out most of the networking, ops, and other management that a company has to do. Most companies have either zero, or very weak ops and admin capabilities. This fact in many companies will actually bring the (I hate saying this) TCO, or Total Cost of Ownership, down for companies building to the Windows Azure Platform vs. the others. Because really, the real cost in all of this is the human cost, not the services as they’re commodotized. Again though, this is for small non-web related businesses – as web companies need to have ops, capabilities, their people absolutely must understand and know how the underpinnings work. If routing, multi-tenancy, networking and other capabilities are to be used to their fullest extent, infrastructure needs to be abstracted but the infrastructure needs to be accessible. Windows Azure does a good deal of infrastructure, and it looks like there will be more available in the future. This will be when the platform actually becomes much more valuable for the web side of the world that demands control, network access, SEO, routing, multi-tenancy, and other options like this.

With the newer generation of developers and others coming out of colleges there is a great idea here and a very bad one. Many new generation developers, if they want web, are jumping right into Ruby on Rails. Microsoft isn’t even a blip on their radar, however there still manage to be thousands that give Microsoft .NET a look, and for them Windows Azure provides a lot of options, including Ruby on Rails, PHP, and more. Soon there will even be some honest to goodness node.js support. I even suspect that the node.js support will probably be some of the fastest performing node.js implementations around. At least, the potential is there for sure. This later group of individuals coming into the industry these days are who will drive the Windows Azure Platform to achieve what it can.

.NET, PHP, and Ruby on Rails Ecosystem (Note, I don’t support of the theft of this word, but I’ll jump on the “ecosystem” bandwagon, reluctantly)

Besides the simple idea that you can deploy any of these to an “instance” in other environments, Windows Azure (almost) makes every one of these a first class platform citizen.  Drop the SDK in my advice, my STRONG advice, and go the RESTful services usage route. Once you do that you aren’t locked in, you can abstract for Windows Azure or any cloud, and you can utilize any of these framework stacks. This, technically, is HUGE to have these available at a platform level. AWS doesn’t offer that, Rackspace doesn’t even dream of it yet, OpenStack doesn’t enable it, and the list goes on. Windows Azure, that’s your option in this category.

The Other MASSIVE Coolness is not Core Windows Azure Features, but They Provide a HUGE Plus for Windows Azure

The add ons to SQL Server are HUGE for enterprises with BI Reporting, SQL Server Reporting, etc. These features are a no brainer for an enterprise. Yes, they provide immediate lock in. Yes, it doesn’t really matter for an enterprise. But here’s the saving grace for this lock in. With the Service Bus and Access Control you can use single sign on to use this and OTHER CLOUD SERVICES in a very secure and safe nature with your development. These two features alone, whether you use other Windows Azure Features or not, are worth using. Even with AWS, Rackspace, or one of the others. The Service Bus and Access Control actually add a lot of capabilities to any type of cloud architecture that comes in useful for enterprise environments, and is practically a requirement for on-premise and in cloud mixed environments (which it seems, almost all environments are).

Other major pluses that I like with Windows Azure includ:

  • Azure Marketplace – Over time, and if marketed well, this could become a huge asset to companies big and small.
  • SQL Azure – SQL Azure is actually a pretty solid database offering for enterprises. Since a lot of Enterprises have already locked themselves into SQL Server, this is a great offering for those companies. However I’m mixed on its usage vs. lower priced mySQL usage, or others for that matter. It definitely adds to the overall Windows Azure Capabilities though, and as time moves forward and other features (such as SSIS, etc) are added to Azure this will become an even greater differentiation.
  • Caching – Well, caching is just awesome isn’t it? I dig me some caching.  This offering is great. It isn’t memCached or some of the others, but it is still a great offering, and again, one of those things that adds to the overall Windows Azure capabilities list. I look forward to Microsoft adding more and more capabilities to this feature.  🙂

Summary

Windows Azure has grown and matured a lot over the time since its release from beta. It still however has some major negatives compared to more mature offerings. However, there is light at the end of the tunnel for those choosing the Windows Azure route, or those that are getting put into the Windows Azure route. Some of those things may even help leap ahead of some of the competition at some point. Microsoft is hard core in this game and they’re not letting down. If anyone has failed to notice, they still have one of the largest “war chests” on Earth to play in new games like this – even when they were initially ill prepared. I do see myself using Windows Azure in the future, maybe not extensively, but it’ll be there. And win a large share of the market or not, Microsoft putting this much money into the industry will push all ships forward in some way or another!

Mac Battles, The Personal Day to Day of Software Development and Morale

I’ve been using a Mac for a couple of months now. My employer purchased a few for us coders to try out, and I’ve become spoiled. I rarely want to use my other machines now, as they seem cumbersome and inefficient. Mainly from a hardware perspective, as the OS itself seems to have plusses and minuses versus Windows 7. But slowly I’m becoming easily as productive, and more, on OS-X as I was on Windows 7. The biggest thing is, OS-X seems to just work the vast majority of the time. In addition, I can dig into parts of it that seem impossible on Windows. In addition, I have almost the entire Unix Ecosystem to play with, which dwarfs the Microsoft Windows Ecosystem by greater proportions than I ever realized. The biggest thing I like about the Mac however boils down to two things:

  1. The Hardware – Simply, the hardware is superb. There is nothing else like it on the market. The single molded body, the touchpad, the keys, everything works better than any laptop I’ve ever used. I’m not saying that as someone that’s used one or two laptops either, I’ve literally used dozens upon dozens of laptops over the years. I regularly try out new ones, and nothing comes close.
  2. The platform OS-X/Linux – Sometimes it may seem like they’re underpowered, this is often a complaint I’ve heard. But considering the efficiencies that OS-X/Unix/FreeBSD/Linux provides, a 4 GB Machine with a simple spindle drive compared to an 8 GB Machine with an SSD running Windows 7 will often perform much better. I have as well as others have benchmarked the Mac Book Pro against multiple Dell Machines, and I’ve seen it done with others, and simply – the operating system gives the Mac an advantage. My suggestion to Microsoft – drop windows and just start building a nice UI on top of a Unix variant like FreeBSD or Linux. It’ll serve Microsoft AND the community better.

I’ll admit, I have installed (not that I currently have it installed) Ubuntu and Windows 7 on the Mac Book Pro (MBP) and windows runs ok, albeit it kills some battery life. Ubuntu runs great, it appears as well as OS-X itself. But even with the others, I’ve primarily just stayed put with OS-X at this juncture. It serves its purpose. In the future, when I purchase a MBP of my own, or even a Mac Air, I will likely run Ubuntu and OS-X on the machine. Setup for Ruby on Rails and lots of JavaScript development.

I know after using this machine, that by the end of the year I will be primarily using Ubuntu and OS-X for almost everything I’m doing – including most likely .NET Development. I however still get the strong feeling that I’ll have a Win7 Machine Floating about and readily available.

As for my morale, it is super high these days building software! A passion indeed. In the future, I’m suspecting about 6-8 months, I’ll have a few announcements regarding improving morale. Until then, cheers!  🙂

Bash, Ruby, and Such Console Installation Version Management Bits for OS-X

I went to reinstall RVM (Ruby Version Manager) and got a message that the command wasn’t available. I realized, after fiddling around for a while that I didn’t have bash setup, and I had tried to run the standard quick install of:

bash <

…I had not setup bash shell as my shell on this Mac?! Oops. So since I’m a virtual noob sometimes, and I have no idea how to setup bash, I did some searching and came up with this solution.

First, switch to bash.

chsh -s bash

Then create yourself a .bash_profile so that you’ll be able to initiate variables and such that you’ll need in the shell. These are used when working with Ruby, Rails, and a whole host of other things. To create a .bash_profile you can follow these commands.  (Snagged from this find)

cd ~/
touch .bash_profile
open -e .bash_profile

Then add this to the bash file.

# place in ~/.bash_profile as the very last line
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Now run the install (usually you’re told to setup this bash file afterwards, but figured we might as well get it done).

bash <

Next exit (or whatever your restart of bash technique is) and open your bash terminal back up. Type this command to be sure we’re on the right path.

type rvm | head -n1

Now to install the latest Ruby on Rails bits you can issue a command like this.

rvm install 1.8.7

However, OS-X already comes with 1.8.7, so you’d probably want to install 1.9.2. I issued the 1.8.7 install since I knew, previously, I’d dorked up the install a few days ago. So it is also a good way to make sure your install is cleaned up. I’m sure though, it could possibly mess things up if you’ve tweaked things the wrong way – but it sure seems to be the case that Ruby, Rails + RVM just works. 🙂

rvm install 1.9.2

Once those are installed you’ll want to set one as default. I’m went with 1.9.2 for now. This can be changed later if need be.

rvm use 1.9.2 --default

Anyway, that’ll get you started on OS-X if you’ve run into the “I’m only running the Terminal in its default setup, I need some bash” situation. 🙂

Happy coding, hacking, and gem installing!

References:

Some references are included above as links, but these below didn’t fit exactly in context at any point, I however used them none the less.