Tech

Tech (92)

Sunday, 05 February 2012 16:02

OpenSuse 11.4 VM (64 bit) interactive installation on XCP

Written by

Install Type

  • Interactive
  • Network boot
  • Commandline

Introduction

This tutorial was written in the spirit of my CentOS 6 VM (64 bit) automated installation on XCP  howto. In that tutorial I do an automated network installation of CentOS 6. This has proven very popular since you can't install a paravirtualized domain using a physical install media. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

There became a need to do the same thing using OpenSuse thus this tutorial.  

Tuesday, 17 January 2012 02:39

My take on Linux Distribution choices

Written by

 

You might say I have a long distro history so I'll add my 1.7 cents (it was 2 cents before the recession).

 
Loved Mandrake until it got buggy. 
Mandriva came from Mandrake but never recaptured the glory.
  1. Both had very easy to use but powerful administration tools. 
  2. Wonderful menu structure
  3. Looked good
  4. Excellent hardware discovery. It could load the drivers for your blender if you could plug it in.
  5. Package management from the Gods when mortal man was painting on cave walls.
Why I stopped using them
  1. unstable repositories. Software was constantly broken. 
 
CentOS for servers - it's just the most stable feature rich distro for servers (from the commandline). 
 
SuSe for servers if you insist on using a GUI to manage it. Has the best GUI Server admin tools.
 
Ubuntu 8.04 - 10.10
  1. Tons of software packages
  2. Gnome2 became usable for bipedal primates with large frontal lobes.
  3. Install process so easy a baby stuck in a mineshaft could do it. 
  4. Everything just works and when it stops shaking a rubber chicken seems to help. If it doesn't work on Ubuntu it probably doesn't work on anything that runs Linux including orbiting brain lasers and fembots with a penchant for evil.
Why I'm looking for a replacement
  1. Software packages broken.... sounds familiar.
  2. Got tired of looking at desktop color themes best reserved for a 1970s kitchen with accompanying man cave with wall to wall shag carpet.
  3. Moved to the Unity desktop which is targeted at a branch of hominids possessing much smaller brain functionality that have been extinct for roughly 4 million years. Possibly as a result of a poor market study with limited subject availability to question and those who they could dig up didn't have much to say.
  4. Including the word Ubuntu in my online dating profile has not improved love matches. In addition translating the original Swahili meaning to English only leaves me looking a bit creepy.
  5. Ubuntu sounds like something my kids used to say when they were a year old and needed changed. Looks like it too.
 
Distributions I'm interested in but haven't made a decision about
 
Linux Mint DE
  1. Based on Debian so the software packages may actually work
  2. Uses the XFCE desktop so any sane human should feel comfortable with it.
Possible downfalls:
  1. A bit rough
  2. A bit ugly
  3. Linux Mint DE with a port scanner vs. Clint Eastwood with a Bowie knife would be a good fight.
  4. Having the same name as another distribution that has broken packages gives me the shivers.
 
Mageia

  1. So far every single package in the repository works. Ex Mandrake developers who must have learned their lesson.
  2. Doesn't talk to me like I'm a baby   

Possible downfalls:
  1. Only two packages in the repository.
  2. Just when I learned to pronounce Ubuntu this comes along.

 
The nice thing about Linux is you can try them all for zero dollars. I think a good practice though is to have a shared network drive where you put all of your stuff so if you choose to wipe out your machine you don't lose anything. Actually this is a good practice on any OS.
 

 

Saturday, 14 January 2012 01:34

CentOS 6 VM (32 bit) automated installation on XCP

Written by

Install Type

  • Non-interactive
  • Network boot
  • Commandline

Introduction

This tutorial was written in the spirit of my CentOS 6 virtual machine (32 bit) installation on Xen howto which was based on the CentOS 5 version of the same. In those tutorials I created a disk, downloaded a kernel, kickstart file plus a xen config file which installed CentOS using the kickstart file. This has proven very popular since you can't install a paravirtualized domain using an install disk. This has been a very nice installation howto because you don't have to download any install CD/DVDs and you could create VMs using nothing more than a commandline login. It's also very nice because it can be mirrored locally if you're doing a bunch of them just by rsyncing a CentOS mirror locally then downloading my files and editing them.

I've recently migrated a lot of my XEN systems to Xen Cloud Platform and it's a very different animal indeed. However, I still needed a system of creating CentOS Virtual Machines in that same manner. I didn't want to download a CentOS install DVD or need a graphical login to install the OS thus this tutorial was born.

It uses the very same CentOS 6 kickstart file from my site as the Xen tutorial. It also uses the very same CentOS 6 repositories on the Internet so in a lot aspects it IS the same tutorial crafted for XCP but will be a bit shorter.

 More after the jump.

Sunday, 01 January 2012 17:07

Changes to Sound Transit bus/train service

Written by

 Note: This post will mean a lot more to those of you living in the Seattle/Tacoma/Olympia area and attempting to use public transportation. It's meant to be humorous but based in reality in a sort of depressing way.

The original Sound Transit announcement for reference.

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

Your current transit news from your transit news correspondent Haywood Jablomey.

Sound Transit remaps the 574 route to connect with the Sounder which goes in the OPPOSITE direction. So for those people traveling from the Airport to Seattle who want to transfer to the Sounder they can now do it at Lakewood… 35 miles from the city.

Pierce Transit after a massive service hour cut adds the 400 route to duplicate the service offered by the Sounder. Sound Transit counters by canceling a portion of the 578 route that duplicates what the PT 400 duplicates of the Sounder route thus saving tax payers $12 which is handed over to Piece Transit and immediately applied to it’s million dollar shortfall easing the tension between Piece Transit and all the cities that pay for it but it no longer services.

Sound Transit add Sunday service to the 578 for all the people who can’t connect to it using Sounder or Pierce Transit 400 due to there not being any weekend service on either.

Sound Transit discontinues the downtown Tacoma portion of the 586 because countless other services cover that route including the Oly Express which doesn’t stop at Tacoma Dome on hours ending with consonants on days ending in y (unless it’s raining then there’s a 50/50 chance due to the letter y not always being considered a vowel) resulting in 605 riders to the U District moving from a 2 seat ride to a 3 seat ride either 30%, 35% or 48% of the time.

Sound Transit extends Sounder south to get closer to 820 parking spots which couldn’t seem to squeeze near the 2283 already available stalls at Tacoma Dome Station thus encouraging people to drive south to park so they can catch the Sounder north back past their houses giving working husbands and wives a second chance to wave to their spouses and check on their lawns. Nobody else notices since the Oly Express still won’t make any sort of intelligent connection to the Sounder effectively keeping the 59x buses annoyingly full.

To discourage people from taking the Sounder Commuter Train Sound Transit has doubled the frequency of both the 590 and 594 in commute direction only thus making better use of empty parking spaces in the city that so far have not been fully utilized because in the past the buses were busy carrying people around. Coffee shops expect to see an increase in ticket sales from the hordes of ST bus drivers milling about during the day. It’s been proposed that cardboard “Occupy Wall Street” signs be added to their uniform so people won’t notice they are in fact employed bus drivers with nothing better to do.

Afraid that there may be some good news buried in the changes somewhere for at least ONE line Sound Transit has doubled the service runs of the 592 bus but stops short of actually delivering passengers anywhere useful. Options are to take the Sounder, walk a block to board the Link and travel one or two stops further north or south. Proposed changes are intended to either leave 592 riders stranded or irritated. Either is acceptable. Rumors of a conspiracy by Jamie Oliver to force long transit connection in an attempt to “slim Americans down” go unfounded. Rumors of him being awarded a second TED prize for an upcoming speech however just will not go away.

Not to leave a sour taste in anyone’s mouth Sound Transit has added ONE extra ST 510 run per day to Everett. It isn’t presently clear at what time a day it runs and it’s existence hasn’t been proven.

And that’s it for this week folks. Have a happy new year.

Wednesday, 28 December 2011 01:55

grep a file in python

Written by

Grep in Linux is an amazing tool. Sometimes I just want the simplicity of grep in Python. This isn't the equal to grep but it will take a regular expression as an argument (two examples shown) and give a return code of success if found or None if not. It will also return the line just like grep. 

 

#!/usr/bin/env python
 
import re

def grep(patt,file):
    """ finds patt in file - patt is a compiled regex
        returns all lines that match patt """
    matchlines = []
    for line in file:
        match = patt.search(line)
        if match:
            matchline = match.group()
            matchlines.append(matchline)
    results = '\n '.join(matchlines)
    if results:
        return results
    else:
        return None

# Example use 
textfile = "/etc/hosts"
file = open(textfile)
criteria = "localhost"

expr = re.compile(r'.*%s.*' % criteria) # finds line that starts with anything, ends with anything and has criteria in it
#expr = re.compile(r'[0-9].*filename:(%s)\schecksum:.*result: (.*)' % criteria) # more complex example

# using return code
if grep(expr, file):
    print  criteria + " is in " + textfile
else:
    print criteria + " is not in " + textfile

file.seek(0) # rewind file for next test

# printing all matching lines
results = grep(expr, file)
print results

file.close()

Since Python is so picky about indention (drives me crazy) you can download grep.py from my downloads section.

Sunday, 25 December 2011 19:36

How to create custom XCP templates

Written by

Creating a template

The following is how to create new custom templates based on existing templates in Xen Cloud Platform. 

1. Get the template UUID that we want to use as our base. As usual just copy and paste the line in yellow into a root terminal on your XCP host.

xe template-list | grep -B1 name-label | awk -F: '{print $2}'

The output should look like this..

 

 688c625b-93b8-8e66-62e5-4542eca1e597

 Red Hat Enterprise Linux 6 (32-bit)

 

 c4e28252-030f-524a-c5d8-7da85df3ccf5

Windows Server 2003 (64-bit)

......

 

Scroll through the list and find the template you want to clone then copy and past it's UUID number ie.  688c625b-93b8-8e66-62e5-4542eca1e597. Choose a new name for your custom template and enter the following line with the UUID of the template you want to clone and the name you want it to have.

 

xe vm-clone uuid=<UUID> new-name-label="<NAME>"
xe template-param-set uuid=<UUID> other-config:install-methods=http,ftp,nfs other-config:default_template=true

Now you should have a new template of your own that you can customize. More after the jump.

Page 1 of 6