Friday, September 30, 2011

Amazon Cloud Services

We have already begun work on our final projects for System Administration, and it's only just over a month into the semester! We are actually doing something that I am very interested in learning, as this is where the future of computing is going: cloud computing.

Defined by Wikipedia, cloud computing is "is the delivery of computing as a service rather than a product, whereby shared resources, software, and information are provided to computers and other devices as a utility (like the electricity grid) over a network (typically the Internet)."

As a class, our plan is to implement an enterprise-level domain onto the Amazon Elastic Compute Cloud (Amazon EC2). We have been given a $200 budget by the Computer Science department that will (hopefully) last us until the end of the semester. Our domain will contain many of the core services found in businesses, including mail, web, authentication, and monitoring services.

Amazon has a pre-defined list of machines available to choose from to implement to their cloud for us to use. The way billing works for this is that you're billed for every hour, including a fraction of an hour, your machine is online. So if you're machine is only online for one minute, you will be billed for the entire hour. As we will be working on these throughout the rest of the semester, on a $200 budget, it was a tough choice to decide what we should run, as machines differ in price.

Below is a list of the pricing model for the EC2:
Region:
Linux/UNIX UsageWindows Usage
Standard On-Demand Instances
Small (Default)$0.085 per hour$0.12 per hour
Large$0.34 per hour$0.48 per hour
Extra Large$0.68 per hour$0.96 per hour
Micro On-Demand Instances
Micro$0.02 per hour$0.03 per hour
Hi-Memory On-Demand Instances
Extra Large$0.50 per hour$0.62 per hour
Double Extra Large$1.00 per hour$1.24 per hour
Quadruple Extra Large$2.00 per hour$2.48 per hour
Hi-CPU On-Demand Instances
Medium$0.17 per hour$0.29 per hour
Extra Large$0.68 per hour$1.16 per hour
Cluster Compute Instances
Quadruple Extra Large$1.60 per hour$1.98 per hour
Cluster GPU Instances
Quadruple Extra Large$2.10 per hour$2.60 per hour

As you can see, pricing can vary from one machine to the next. Linux/UNIX are typically the cheapest machines, while Windows machines tend to be a lot pricier. As a class, we needed to come up with a plan on what types of machines we would use so we didn't go over our budget before the end of the semester. Many of us voted for the use of Linux machines, as they are cheap to run daily and even monthly.

The class was then divided into teams, based on what people wanted to work with from the above services. Many people were interested in mail and authentication, but I chose to stand out and go with monitoring services. My group and I decided that we are going to be using a free open-source monitoring service called Icinga. Forked from the popular free monitoring service, Nagios, Icinga is an "enterprise grade open source monitoring system which keeps watch over networks and any conceivable network resource, notifies the user of errors and recoveries and generates performance data for reporting."

I am very excited to complete this project, as it is a grateful experience to be able to learn this new technology at a young(er) age and come out of college and be able to say, "I have experience with cloud computing." I will try to keep this updated as much as possible with my experience.

Content Management Systems

Last week in my System Administration course, we were assigned a small individual project involving setting up and documenting the installation of a content management system. The websites would be hosted on our professor's cluster, where we would be able to VNC into a console and configure the website behind the scenes. We were able to pick our operating system of choice and a (free, open source) content management system to use for our website. Feeling curious, I was personally a little interested in stepping outside of my own boundaries and decided to take the Non-Windows approach to this task..




For my operating system, I selected Debian. Debian is a "free operating system (OS) for your computer. Debian uses the Linux kernel (the core of an operating system), but most of the basic OS tools come from the GNU project; hence the name GNU/Linux."

I had little experience with Debian before this project. We used it in last year's Cyberdefense Competition at Iowa State University to run our Snort firewall. While I did little installation and configuration on my part for the system, I was able to understand the basics of how to use it and figured I should get more comfortable with it before this year's competition.



As for my content management system, I went with a very popularly used management system named MediaWiki. MediaWiki is a "free software open source wiki package written in PHP, originally for use on Wikipedia. It is now used by several other projects of the non-profit Wikimedia Foundation and by many other wikis."

I had never setup a content management system myself and hardly used any before. Again, my only experience with MediaWiki in the past was for the Cyberdefense Competition, where we needed to document all of our systems and configurations. That was one of the gems of why I chose MediaWiki over other CMS's, like SilverStripe or Drupal, is that MediaWiki is very useful for documentation.


Overall, I was really satisfied with how the configuration and installation of this management system went. I found that package installation and configuration can be a lot simpler than some Windows-based software and it made me enjoy this project more. I ran into a few snags here and there and ended up having to scrap the entire project and start over after realizing I had forgotten to take screenshots for my tutorial (oops!), but I also realized I had skipped and messed up a few steps, such as installing an old version of MediaWiki, so it was nice to get my feet wet before jumping in.


My website can be found here, where I have a full in-depth tutorial on how to setup and configure MediaWiki on Debian.

Tuesday, September 13, 2011

Creating Layouts

Last week we completed our second "proof of concepts" for mobile programming: layouts. The least I can say about it is that it was a nice way to begin to delve into Android programming and get a feel for the basics of UI functioning. We were tasked with creating a few different layouts as examples (just dummies) to show that we are able to do so.

To begin, you must first create a new XML and Java file for your layout. Your new Java files will be located under src\packagename\appname\file.java and your XML will be located under your res\layout\file.xml. These files can be started out the same as the default files that are loaded with each new application, which are located under the same folders as the other two specified before. The Java file will be the name of your application, and the XML will be under the name main.xml (this refers to your main/home layout for the app).

I started by just creating a simple home screen that asked what type of layout you'd like to use: linear, table, or relative layouts. This screen was made, itself, using a linear layout.



Linear Layout: organizes controls linearly, in either a horizontal or vertical fashion. When the layout's orientation is set to vertical, all child controls within it are organized in a single column; when the layout's orientation is set to horizontal, all child controls within it are organized in a single row.
My linear layout is a very basic user input of a username and password. After the user has clicked "Log In", it will prompt them with a "Welcome" message (again this is just a dummy, doesn't actually log into anything).



Table Layout: a grid of made up of rows and columns, where a cell can display a view control.
My table layout, again, is just a very basic user input and again prompts the user with a "Welcome" message when they hit the login button.


One issue I continually ran into with the table layout, and still am, is getting things to align correctly. The columns expand dynamically to the sizes they need to be, but will push others away if needed. An example of what I'm talking about is when I click the "Log In" button, the "Welcome" message will push the edit boxes off of the screen partially. Hoping I can find a fix for this soon (or just simply avoid a table layout in this case).



Relative Layout: it organizes controls relative to one another, or to the parent control itself.
Finally, the relative layout was the simplest to use in terms of being user-friendly. As defined before, it allows the author to organize everything relative to other controls/widgets on the screen. This was much easier because I could simply tell the XML code that I wanted to display a TextView below my "Log In" button and how far away I wanted it to be.


After I had all of my layouts created, the next step was to create new activities for the app to be able to load these different layouts when I asked for them. As defined by the Android Developers website, "An activity is a single, focused thing that the user can do." To do this, you must add each new layout class to be loaded by the Android Manifest file. An issue that took me a few hours to notice about this was getting my different activities to load. This was due to not adding them to the manifest file to begin with, and shortly after they
were added, and a few debugs, everything was running as intended.

We are continuing to mess with basic UI functions for this week, and not much should change.


Source code for my "Layouts" app can be found here!

Thursday, September 8, 2011

Hello, Android!

As well as my System Administration course this year, I am also taking in a new class to the university called CS4880 (aka Topics in Computing: Programming for Mobile Devices). The class is exactly as it is named, programming for mobile devices.

The first day of class started with discussion of what our professor would like us to be able to accomplish and learn by the end of the semester, as well as signing waivers for the phones we'd be provided with for the semester. We were handed our LG Optimus T phones and simply asked to go to the market and review 6 apps to start the semester, but that is not what I'm on here to post about. Our next task was to begin the actual setup and programming of applications.

Our first program we wrote was a simple "Hello, World!" app that was named "Hello, Android!" (clever eh?) This was a task that was pretty simple, as the Android developer site has a tutorial how to do this step-by-step. Instead of reinventing the wheel, I figured I would simply post up the developers site with the exact same tutorial so you guys can take a look (link will be posted at the bottom). This tutorial shows users how to setup/install the IDE and the Android SDK to create virtual Android devices that can be launched from the computer (as not everyone owns an Android device). It allows you to choose from different versions (i.e. 2.1, 2.2, 3.0) and run the apps as if you were using a device with that version.

From my early experiences of working with Android programming, it seems as though they basically took Java and made a love child of their own, mixing and matching a lot of the Java libraries with the Android libraries. As such, I did finally manage to get my IDE and SDK up and running and created my first Android app! (*applause*) It is very simple, as you can see from the screenshot.


This class is something that really interests me and I hope I can think up some interesting apps to create. If anyone has a suggestion or an idea, feel free to let me know! I do like ideas. I haven't done any programming in over a year, but as I just said, this is a very interesting field to me, so I say to you, CS4880...




"Hello, World!" tutorial can be found here!
Source code for my "Hello, Android" app can be found here!

Thursday, September 1, 2011

Adding Users

As stated in my first blog post, I was tasked in my system administration course with adding users to my machines (Windows 7, Windows Server 2008 R2, and OpenSolaris). The Windows machines themselves were no challenge at all, although OpenSolaris did frighten me a bit when I first booted up the machine. After some quick Googling though, it was quite easy to figure out. Below I will be posting a tutorial for each machine and how to add users to it.



Windows 7

1. Begin by pressing the start button (Windows logo), right click on My Computer and go to Manage.

2. Under Computer Management, expand the System Tools menu. Then expand Local Users and Groups and select the Users folder. You should receive a window similar to this:

3. To add a user, you can go to Action -> “New User…” Alternatively, you can right click in the whitespace below the current list of users and select “New User…


4. You will be prompted with a dialog box like shown below.

5. Simply enter in the user’s information into the dialog box. Note: be sure you have “User must change password at next logon” unchecked. When you have entered in the required information, click Create.

6. Do this for each user until you are complete. When you have finished, click Close. You should now have local users added to your computer and they should be viewable in the previous window. You have now successfully added users to your Windows 7 machine!


-----------------------------------------------------------------------------------------------------------------------------------


Windows Server 2008 R2


1. Begin by pressing the start button (Windows logo), right click on My Computer and go to Manage. Alternatively, you can click the Server Manager button on the taskbar (indicated by the red circle).

2. Under Server Manager, expand the Configuration menu. Then expand the Local Users and Groups menu and select the Users folder. You should receive a window similar to this:

3. To add a user, you can go to Action -> “New User…” Alternatively, you can right click in the whitespace below the current list of users and select “New User…


4. You will be prompted with a dialog box like shown below:

5. Simply enter in the user’s information into the dialog box. Note: be sure you have “User must change password at next logon” unchecked. When you have entered in the required information, click Create.

6. Do this for each user until you are complete. When you have finished, click Close. You should now have local users added to your computer and they should be viewable in the previous window. You have now successfully added users to your Windows Server 2008 R2 machine!




-----------------------------------------------------------------------------------------------------------------------------------




OpenSolaris

There are two methods of adding users to OpenSolaris: by CLI (command line interface) and by GUI (graphical user interface). In this guide, I will be showing you how to add users via CLI. Note: you must have administrative or root privileges through this method.

1. Begin by opening a terminal, either by going to Applications -> Accessories -> Terminal, or you may click the Terminal icon located on the top taskbar (circled in red).

2. You should have a terminal window opened like this:

3. Once you have opened a terminal, you must elevate your privileges to root to add users. To do this, you enter in the command “su”. The terminal will prompt you for root’s password. After successfully elevating your privileges, you will notice your terminal will change from ~$ to ~#, showing that you have successfully logged in as root.

4. 
To add a user, we use the “useradd” command. In the terminal, type the following command:
useradd –d /export/home/username –m username
Replace “username” with the desired username you wish to add (in this example, I used “diggums”). You may have noticed we used a few parameters with this command. The “-d dir” parameter specifies the home directory of the new user, and the “-m” parameter will create the new user’s home directory if it does not already exist.
For more information on the useradd command, see “man useradd”.
”.

5. After you have successfully added the user, we must set their password. We do this through the “passwd” command. With your privileges still elevated to root, execute the “passwd” command followed by the username you wish to set the password for. After you execute the command, you will be asked for a new password and a re-entry to confirm the correct password. If you enter in the new password correctly both times, you will get a message saying “passwd: password successfully changed for <username>”.

6. Repeat steps 4 and 5 until you have added all the users you wish to add. When you are completed, simply type “exit” to log out of the terminal as root and back to your local user account.



-----------------------------------------------------------------------------------------------------------------------------------


This may not have been the most difficult task to begin the semester with, but I'm excited to see what I can be put to the test to accomplish by the end of this semester!

Wednesday, August 31, 2011

It Starts...

Well, most of my friends had been doing this blog stuff, and I had an occasion arise that I thought gave me a good reason to start one myself. Last week in my System Administration class, we briefly went over what our teacher is expecting to cover with us over the course of the semester.


We were told we would be working with three systems setup by our professor: the first, a Windows 7 Enterprise x64; the second, a Windows Server 2008 R2; the third, OpenSolaris 2009.06. These machines are accessible through a unique VNC port on a remote Proxmox cluster hosted by my professor, Dr. Gray. The reasoning behind two Windows machines and a Linux machine was for this reasoning: Windows is common to the majority of the population, which will be very familiar to most of us; the Linux machine will give us the opportunity to lay hands on an operating system that is out of most of our "comfort zones".


Over the course of the semester we will be working with these machines as if they are a live environment, from active directory to mail services to whatever challenges Gray feels we need to be tasked with. As documentation is going to be a large part of my grade (at least 1/3), I decided it would be a good idea to keep a blog of my studies for both personal and educational knowledge. So throughout the following blogs, I will most likely be documenting what I have been up to with my studies, and occasionally something outside the norms of school, or something just funny.

The first mini-project I was tasked with in my system administration course was to create local users for our three machines we were given. I will be posting up brief tutorials on how to add users to each system.