Entries Tagged as 'Technology'

mod_cfml graphic

I'm working on the mod_cfml site and while playing with Photoshop and working up graphics for it, I made the following. I really like it! Hope you do too.

mod_cfml logo

The tricky little "httpd -M" command

A project I'm doing requires that I write a BASH shell script that checks what modules are installed in Apache (to make sure some requirements are met before an install is attempted), however, I had a HECK OF A TIME figuring out how to script the checking of the httpd -M command (the command that shows the installed Apache modules). I was tring to run the following on a CentOS 5 server:

# httpd -M | grep -c perl

And the results of the command were not being piped to grep. Instead, the results were being sent to the screen. Irritating! There's clearly a pipe character there. I kept thinking I was writing the command wrong or something. I tried the command on my Ubuntu desktop, and lo and behold it worked just fine:

$ sudo apache2ctl -M | grep -c perl

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Syntax OK
1

Broken ApacheThe "1" was the result I was looking for, because I knew mod_perl was installed.

Long story short, for some reason the CentOS 5 version of Apache sends the "httpd -M" results to stderr, rather then stdout. I have no freaking idea why it does this, because that's not error data. It seems like a bug in the HTTPD executable. The end result was that I needed to write my command as follows:

# httpd -M  2>&1 | grep -c perl

1

The 2>&1 sends the stderr data to stdout which is what the pipe character sends to the grep command.

How annoying. For the record:

# httpd -v

Server version: Apache/2.2.3
Server built:   Oct 20 2011 17:00:12

Hope this helps someone avoid the frustration and confusion I went through finding it.

BASH - Generate a Random String

In a recent project, I needed a function that would generate a random string for me. In my case, I was creating a random file name to store some data, but there are other uses as well, so I am posting the BASH code here in the hope that it will help others out ther eon the net writing BASH scripts and need a good random string function:

#!/bin/bash
function randomString {
        # if a param was passed, it's the length of the string we want
        if [[ -n $1 ]] && [[ "$1" -lt 20 ]]; then
                local myStrLength=$1;
        else
                # otherwise set to default
                local myStrLength=8;
        fi

        local mySeedNumber=$$`date +%N`; # seed will be the pid + nanoseconds
        local myRandomString=$( echo $mySeedNumber | md5sum | md5sum );
        # create our actual random string
        myRandomResult="${myRandomString:2:myStrLength}"
}

randomString 10;
echo $myRandomResult;

FireFox with Bing on Linux

I'm running a Linux Desktop - Linux Mint to be precise.

I just recently read about the news that FireFox has announced a partnership with Microsoft where you can download a version of Firefox that has Bing set as the Home Page, as well as offers Bing search by default. So... like all technophiles do, I went to go check out the new cool tech by visiting their site over at http://www.firefoxwithbing.com/. Instead of a great new browser with great new search options, I got this instead:

Thinking about it, I should probably have expected that, but I found it ironicly funny anyway.

A Look Inside a Vivio VPS Platform Server

In my recent post, "What 256GB of RAM Looks Like", I showed some pictures of some RAM that Vivio had bought to put in to a couple of new platform machines. After that post I got a couple of requests to see it inside the servers that it was going to be in, so I took some pictures of one of the two new Platforms we built this month for those of you who might be interested in seeing the platform machines we use.

vivio vps inside

There are two Opteron 8-Core CPU's here, for a total of 16 CPU cores. The RAM is the same RAM that I showed in the pictures earlier. Each RAM module is 8GB, making for a total of 128GB in each of the two servers we put together this month. The CPU's and RAM are cooled using passive cooling and a fan "funnel" (at least I think that's what it's called) in which 4 separate fans drive air through the funnel.

vivio vps HDD array sas

This platform will be named "Arcticwolf" - which indicates this particular server will be used for Windows VPS Accounts. It will contain 16 Seagate Constallation SAS drives (14 usable and 2 spare). The amount of drive space we will be providing by default in new VPS Accounts will increase (a great deal) in the not too distant future as the price of exceptional drive arrays like this one goes down.

vivio vps psu

The system comes complete with redundant PSU's, so if one of them fails, we can replace it without needing to shut the machine down. 

Personally, I think these servers are just plain awesome in carnate, but that's probably just my predjudice talking. ;)

imported-ancestor