Subscribe
Search
Monday
Oct312011

Rebuilding a Sun Cobalt Qube 2 (Part 1)

I am going to start by warning the Windows System Administrators that the next few blog posts will not contain any Microsoft products.

Remember the good old days on the Internet? Do you remember the .COM boom and bust?

Well, I get to reminisce on an almost daily basis because one of my main servers at home is from that very time period!

Last year I bought a Sun Cobalt Qube 2 from eBay. I was so excited to get my hands on one of these little blue boxes, at the time I didn’t consider what I would use it for, not to mention what operating system I would be running on it. All I knew was I would have my very own Qube 2, and not one of the x86 sell out Qube 3 units!

When I was a very young IT Professional, quite a number of people I knew were involved in running various Cobalt systems, and in fact some of my early web development, system administration and security experience were on the platform. This was something of a teenage-hood dream that one day, I might get to own one.

Specifications (http://www.computinghistory.org.uk/det/1112/cobalt-qube-2/):

Cobalt Qube 2

  • 64Bit MIPS RISC CPU QED RM5231-250Q (superscalar, 250MHz)
  • System Controller: Galileo GT-64111
  • PCI-ISA Bridge/ATA Controller: Via VT821C586 (Apollo VP)
  • 1x16MB RAM (EDO 3.3V, SIMM-Modul 72 Pin, proprietary) – Mine has 128mb!
  • Maximum memory: 256MB
  • Ultra-ATA 10.2GB hard drive (Seagate ST310212A)
  • Maximum fixed disk capacity (BIOS limitation): 30GB
  • 2 network interfaces (Tulip) DECchip DC21142 10/100baseTX-FDX
  • 6-key-panel + 2x16 LCD-Display
  • 1 high-speed serial port (SubD9)
  • 1 PCI-slot (proprietary)
  • 1 housing fan (4x4 cm, 12V, unsettled)
  • 1 small, external 36 Watt power supply unit (12V, 3A)
  • Dimensions: 18,4cm x 18,4cm x 19,7cm
  • Weight: 2.8kg
  • Power supply: 100-240V, 50/60Hz
  • Power input: 25 Watt
  • Operating environment: 5-40°C, 10-80% air humidity
  • Non-operating environment: -10-50°C, 5-93% air humidity
  • Original retail price (2000, through Sun): approx. USD 2500

The big thing to note is that it isn’t a standard x86 or x64 CPU, it’s a little endian MIPS processor, and thus you will need an operating system designed specifically for it.

I decided in the end that this server would run Subversion to keep track of all my PowerShell code versions, as well as some personal PHP content that I wrote. All it would need is Subversion, Apache and MySQL.

When the unit arrived, I did some initial investigation and discovered I had one of basically 4 options for what operating system to run on the Qube:

  1. The original OS (quite out-dated and very vulnerable)
  2. A Debian port to the CPU.
  3. A Gentoo Port (Experimental)
  4. NetBSD (very mature)

I decided that I would indeed run a more modern operating system and thus ruled out option 1. I decided that Debian would be easier as I am quite familiar with it and Ubuntu.

The Ubuntu install was pretty easy however after a few days it was easy to see that the performance was poor, something that I discovered as a known issue with some of the Qube 2.

I then went on to using NetBSD. This was such a learning curve for me, as for once I had to learn how to use UNIX properly, and there would be no nice friendly finishing touches, and it certainly wouldn’t be as easy to install or use as Linux.

The biggest thing that I needed to get my head around first was text editor VI, this was quickly followed by the Shell which was CSH (not the friendlier BASH) and finally that I would need to COMPILE my applications outside of what was already there! There is a very easy to use and friendly system called PKGSRC which allows you to quickly find and compile your applications; not only that but everything there is tested and made to work on NetBSD, so it will all just work when you need it to.

So, through a lot of messing about I did indeed get the system running, but I wasn’t 100% happy with it, and I never really made my notes into a sensible form. The system ran for almost a year without fault, until last week when it all came crashing down.

I went to install a new application, and soon discovered that the pkgsrc tree was out of date, when I went to update this, I realised I lost my connection. After an hour of trying to update and then loosing connectivity, I ran the uptime command and realised the system was indeed rebooting; further investigation made me realise that the file system had become damaged! Oh no, my previous Qube!

I decided to try and reinstall the operating system, this would also allow me to install NetBSD 5.1 (I originally installed 5.0) and also update all of the applications at the same time. This time, I would document the process.

I will have a number of blog posts over this week and next covering everything I will be doing to bring my little Qube back to a functioning state.

Tuesday
Oct252011

Regular Expressions in Powershell

As part of a script I am working on, I needed to parse some web content which was stored on a remote server; in this case, I needed to scrap a particular set of web links of the page and report back.

The best way to get content of the internet from within a script is wget, which from within Windows you can make use of the GNUWin32 project. I will post about how useful this project is to Windows Scripting and administration later!

Back to the topic at hand.

After getting the content from the web and saving it as a file, I then put the content into a variable using Get-Content, from there, searching the content was pretty easy. First you need to make a RegularExpression.Regex object, and from there, you can feed any string into that object, and it will return the matches.

For Example:

Wednesday
Oct192011

Server Timezone Script

Time for another one of my quick powershell scripts.

This script was created because we discovered we had servers at the Brisbane site, who were running with Daylight Saving time, and also found some servers in Sydney who were not.

For a list of computer names, this script will check that the timezone is "Brisbane" and output the ones who are not to a file.

 

Wednesday
Oct122011

Creating 1.5 million users in AD

Ever needed to create A LOT of user accounts?

Try this script: (uses Quest CmdLets)

 

Monday
Oct102011

Service Monitoring and Recovery with PowerShell

Recently, Symantec Backup Exec was crashing quite regularly on me.Every Saturday at 4am, the main Backup Exec service would coem crashing down, taking the weekly backups with it and then causing my Monday morning to be painful (unless whoever was on call managed to see that the backups had stopped).

I know that this sort of monitoring should be done with something like SCOM, but that wasn't something I could do in this situation.

The solution was a PowerShell script running hourly (or more or less depending on the needs) that would look at the running state of all the Backup Exec services and start any that were not running, as well as send the person on call an email to tell them something bad was happening.

Using my standard template (see previous postings), I added one parameter to the script, $query, which is simply the query string that I would pass to get the services I want to monitor. For example, a query string of "backup*" will return all the Backup Exec processes, a string of "spooler" would return the print spooler.

The body of the script is pretty simple: