Wednesday, May 11, 2016

Spinning up a Virtual Machine for Learning New Technologies

As a new developer, I try my best to learn as much as I can in the shortest time period.  One of the best advice I've gotten was from a couple of co-workers when I was asking for help on a problem.  I was enamored with the complexities of git and couldn't learn how to use it effectively fast enough.  So after a bit of reading on my own, I'd come to these developers and ask semi-specific questions about what I was trying to accomplish.  After about a week these 2 individuals said "When we try to learn something new, we just start playing around with the technology.  When you want to know if git rebase will delete your history, create a repo with some folders and files in it, and perform a rebase after a couple of commits."

This advice sparked a flame in the way looked at learning.  With this new advice, I started to create sandboxes everywhere, and for everything.  Anything from git, mongoDB, mysql, c#, python, powershell, and everything in between, I started just doing it and seeing what happened.  That way, when I was working on something at work, I already knew the consequences of the not so familiar method/command.  

What is a great place to play around and not have to worry about destroying your computer?  A Virtual Machine.  There are a number of Hypervisors out there that can be used to create one.  From Hyper-V, VirtualBox, and my favorite VMWare.  This post will focus on creating a VM on VMWare. There are some pre-requisites that you need is to download the following:
  1. VMWare Workstation download.
  2. Ubuntu 16.04 LTS download.
There are many Operating Systems available, over 100 linux distributions that I can think of, but you could always use Windows if you have a license and a current installation ISO or disks.  One of the benefits of the 2 listed downloads is that they're free.  So now that those are downloaded, we can get started.  

The first thing you'll want to do is double click the file downloaded from the VMWare link and follow the on screen instructions.  Once that is done you should open up VMWare and you'll see the Home screen of the program.  From there you'll follow the following steps:
  • Click on "Create a New Virtual Machine"
  • Select the "Installer disc image file (iso)" radio button.
  • Click Browse, and find the downloaded ISO of Ubuntu that was downloaded earlier.  Then Select Next.  This is most likely in your downloads folder.
  • On the next screen fill in the fields to Personalize Linux and Select Next.  Remember this information, as it will be used to login to the Operating System once installed.
  • Now give the VM an allotted amount of space to take up on your hard drive and click Next.  I recommend 20gb, but you could go greater or less based on your use case.
  • On the next screen you can customize some more of the features such as memory.  I usually set my Memory to 2gb's but you can get away with as little as 512mb's.  Keep in mind that the VM is borrowing resources from your host machine, so you don't want to just crank everything up to the max.  Once everything is to your liking click Finish.
  • Now after about 10 minutes and a few questions, you should see the Ubuntu Log In screen.  Use the password created earlier to login and you are done.
Congratulations!  You've just created a Linux based playground to perform all of your coding experiments without having to worry about destroying your host machine.  And one of the best things is that if you really hose up the VM then you can just delete it and start over again with a clean slate by just following these steps again.  Note that you can have multiple VM's created at a time pending that you have enough hard drive space.  

If you are having problems with the Internet inside the VM, you may have to play around with the Network settings of the virtual machine by changing them in the VMWare application.  I hope this helps someone learn new technology as that is what I love to do in my spare time.

-Kwiknick

Wednesday, April 20, 2016

Getting Started learning Docker

With all of the news about windows playing nice with linux in recent times, I've decided to get my feet wet in the docker world.  So I wanted to share some of the resources that have helped me get a grasp on the capabilities of Docker.

Being able to deploy a container with all of the dependencies and the newly written code in a matter of minutes with everything in the environment being the same.  So say goodbye to environmental issues when testing, developing, and even using in production.  This makes me so happy I picture myself sitting on a beach with a drink in hand instead of looking at logs trying to figure out what went wrong.

Here is a video that in my opinion gives an excellent high level view of what Docker is:


Here are some links to 2 useful blogs I read, and a link to the Docker in windows walk-thru.  Dockers walk-thru's are surprisingly really good and will definitely help someone get started.

https://blog.jessfraz.com/

https://jpetazzo.github.io/

Getting Started with Docker in Windows

Using Dockerfiles to Build images - Explained

Tuesday, March 1, 2016

How to Fail When Exposing a Linux Server to the Internet

Recently I restarted an old dream of having a home server out of an old computer.  Years ago I took my old desktop and decided that it was a prime candidate.  64bit AMD processor 8GB's of RAM and a 1TB Hard drive seemed like the perfect fit.  I had another 20GB hard drive laying around that I used as a host for the OS.  Flash forward 5 years and when I'm actually in the IT field, and I decided to make the main HDD a TB as well.  So I reinstalled Ubuntu 14.04 LTS, and started to play around.

One of the first things I couldn't wait to do was have the ability to SSH into my machine.  I got this setup in a day and was so excited.  So what is a person to do with this capability?  Setup a DDNS and remote in via SSH.  This seemed like the coolest thing in the world.  The ability to sign in to my home server from anywhere!!!  But wait, if I can sign in from anywhere, so could anyone else.

A friend of mine is a Project Manager for an IT company where I live.  In particular, he manages projects in the security side of his company.  So at lunch a couple days ago I was talking about my home server and how happy I was with being able to SSH into it from anywhere.  The first thing out of his mouth was, "I hope you're not using default ports."  My stomach dropped as I never changed anything that was default when setting anything up.  As soon as I got home I grepped the auth.log file in the ssh folder for *failed and the results were daunting.  At a minimum, I was getting hit every 4 seconds. Anywhere from Australia to Amsterdam, hackers were trying to hit my open ports.

So lesson learned that I want to share with anyone is if you want to create a home server that you expose to the internet, use a VPN, or if you stick with SSH, at a minimum change the default port.

-kwiknick