Building a Linux-Based Appliance
It seems to us that user interface design and construction is always harder than it appears. As soon as you get more than three or four basic options on the screen, you have to figure out how to organize them in a way that really works and makes sense to the user.
We have found that many Linux tools do not make use of a commonly available but often overlooked capability: color. The use of colors is important to help differentiate the information you are trying to convey to the user. In a terminal window, use of only a few ASCII color codes can mean the difference between lots of hard-to-read text and an easy-to-use menu system.
Rather than trying to use the ASCII color codes each time you want to change your output colors, it is easier to assign common color selections to variables in your scripts. This will save time and makes colors much easier to work with. Here is an example:
my $white = "\033[97m"; my $nocolor = "\033[0m\033[39m\033[49m";
To output a line with multiple colors, you would simply print out the corresponding variable to create a simple menu:
print "$white 1: $nocolor Menu Item 1\n"; print "$white 2: $nocolor Menu Item 2\n\n"; print "Please choose a valid menu item from above ($white 1/2/C $nocolor ancle):";
The result appears as follows:
--------------------- 1: Menu Item 1 2: Menu Item 2 Please choose a valid menu item from above (1/2/Cancel): ---------------------
In another part of our product, the user must choose from a list with over 200 options. To address this issue of multiple options in a terminal-based environment, we came up with the idea of matching on a part of the word to search for. Although we do allow the user to display the entire list, enabling a partial string search made it significantly easier to locate desired services. The following code demonstrates searching for text in an array within Perl to support this functionality.
The @printobjectoutput file contains the entire list of services available. For each element in the array, we strip out all unnecessary characters and display modifiers (such as tabs) and compare that to the search string entered by the user. We then display the list of matching services for the user to select and include in the rule they want to add. We identify each service with a number to make item selection easy.
print "What would you like to search for?: ";
chomp($match = <STDIN>);
print "\n";
foreach $element (@printobjectoutput) {
$element =~ s/^\s+|\s+$//g;
if ($element =~ /$match/) # returns true if
$match is in $element
{
print "$white $printobjectcounter";
print "$nocolor $element\n";
}
$printobjectcounter++;
}
print "\nWhich service do you wish to apply to the
rule?: ";
chomp($pickedservice = <STDIN>);
Here is some sample output generated by the code above:
------------------------------------------- What would you like to search for?: timestamp 229 timestamp 230 timestamp-reply Which service do you wish to apply to the rule?: 230 -------------------------------------------
Our product supports three types of backup/restore/undo capabilities:
Full backup and restore via disk imaging
Manual/scheduled backup of critical system and firewall configuration files
An iterative undo capability
As you may recall, a unique aspect of our hardware platform is it includes two complete systems in a single box. We utilized PartitionImage because it allowed us to make an exact copy of the first machine in this two-machine box. We were then able to create an image file that could be heavily compressed and stored on the second machine. Even if there is a total failure of one of the machines, the user doesn't need to have a boot disk, CD and so on. Instead, they can simply boot up the other machine and get the whole system back up and running. We also support a Restore CD for a worst-case scenario, although this tends to be confusing to the end user. Both the hard disk-based restore and the bootable Restore CD make use of PartitionImage.
To use PartitionImage, we booted from a Linux boot disk that loads the necessary drivers and other utilities necessary to access the drive you want to make an image of. It also can load your network drivers if you want to store the image across the network, which was one of the benefits of the tool. You can then choose to make an image of the drive on any other partition of that machine or across a remote networked filesystem (e.g., to another machine or storage device). PartitionImage makes an exact copy of the disk, sector by sector; it doesn't simple copy the files. PartitionImage has floppy disk images available on their web site that make it easy to create the boot disk.
Using PartitionImage also was critical during the development phase of the product. In some cases, we would make so many configuration changes to the system, it would be unclear whether we had really gotten back to the original state. And there was no way to get back to the original setup and know for sure that it was a "clean" version.
The key was to create an image once we had installed the operating system to the state that we wanted, plus the application software, and performed the initial configuration. Otherwise, if we had had to reload the OS from scratch, install the application, then load any patches or updates, it would have been hours versus minutes. Your development time is also much better spent, because you can hit restore, go work on something else and come back when it is done.
Restoring is as easy as backing up. You can restore either from the local hard disk's other partition (the one you saved the partition to) or from the remote machine.
In summary, PartitionImage is easy to use. It's an open-source tool that is constantly being updated and that is well supported, and it's available free-of-charge. It was a complete and supported tool that met our needs and withstood our testing.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
| Android's Limits | Jun 04, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Linux Systems Administrator
- Introduction to MapReduce with Hadoop on Linux
- Senior Perl Developer
- Technical Support Rep
- Weechat, Irssi's Little Brother
- UX Designer
- One Tail Just Isn't Enough
- Android's Limits
- Reply to comment | Linux Journal
40 min 48 sec ago - Reply to comment | Linux Journal
41 min 15 sec ago - Replica Watches
3 hours 6 min ago - Reply to comment | Linux Journal
7 hours 16 min ago - on the path to understanding
7 hours 20 min ago - As a fisher,we know that a
1 day 2 hours ago - All I Say Is Worth Share!
1 day 3 hours ago - GeekSays
1 day 4 hours ago - thanks
1 day 7 hours ago - You should consider visiting
1 day 8 hours ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?



Comments
Ruby on Rails Appliance
Great info! Myself and a coworker recently built a remote backup appliance using a standard linux distro and ruby on rails. We've thought about turning it into a kit complete with source code to help give others a springboard to develop from. Any interest out there for something like this?