Default Windows 7 Partitioning Brakes WDS Imaging…….Kinda…….

December 23rd, 2010

Another little Windows 7 nugget.

While installing Windows 7, I noticed that during the section for setting up the disk, some stuff was going on that I didn’t ask for (didn’t realise it at the time, took some trial and error to figure it out).

When you configure Windows 7 installation, the graphical section for configuring the disk will automatically create a 100MB primary partition for Bit Locker to use at a later stage. No matter what I did, I could not stop the GUI from doing this.

So I pressed on and agreed to the installation with the 100MB partition at the begining of the disk and the rest of the disk as a another primary partition.

Windows installs the *boot* files into the 100MB partition, and everything else into the second larger partition !

As I have mentioned before, I don’t think I am using WDS and imaging as Microsoft intended, but I essentially create a machine exactly how I want it and then sysprep and capture it using imagex. I can then reapply the image to another system of have it on the desktop in approx. 10-15mins all ready for use.

But this dual partition configuration breaks this. I believe to do it this way I would have to perform x2 sets of imagex capture and deploys :o( Not going to happen.

To get around this, I have to prepare the disk partitioning up front. The GUI disk section of the install will not alter the disk if it is already partitioned. I booted using a WINPE boot disk used ‘diskpart.exe /s ‘ and pass the following in a txt file as an argument

select disk 0
clean
create partition primary id=07
select partition 1
format fs=ntfs quick nowait
assign letter=c
active

This causes diskpart to select the first disk, wipe it clean and then create a primary partition using the whole disk, mark it as active and assign it drive letter C:

With the disk prepared in this way, I can now install Windows 7 (skipping over the GUI section of disk partitioning) and the boot files will be on the same partition as the system files. This can then be caught in a single image capture to .wim file which, when I then apply back to machines via WDS they will boot correctly.

Not sure of the implications this has should you then want to use Bitlocker at some later stage. Meh ! I don’t care, I don’t use Bitlocker right now :o)

Hope someone else finds this useful :o)

TFL You Suck (well, your staff do !)

December 11th, 2010

Ask anyone who knows me, they’ll tell you I’m awesome. They’ll also tell you it takes a *lot* to make me angry to the point of expressing it.

So hats of to TFL, you can add me to what I am sure is an extensive and rather long list of people who wish there were an alternative to getting around London.

Am I being harsh ? You tell me.

I just tried to enable the auto top up feature on my Oyster card. The create account page asked for the normal stuff. Name, address, oyster card number, email, a security question and a password (to be entered twice for verification). I filled everything in and hit submit. The form bounced back that my passwords did not match. I corrected this and resubmitted. It came back that that email address is in use !!!

WFT

Email addresses are unique. I’ve never registered before. So unless someone else has tried to imitate me, (which seems like rather a lot of work to scam an oyster card), it seems their form partially submitted my data with incorrect values for some fields.

Genius !

Any attempt to logon, retrieve username or password met with failure. Whatever values the form had passed, they weren’t the ones I’d used.

When calling their helpline to sort the humpty dumpty mess out, the dumber than average rhesus monkey I spoke to said there was nothing he could do (maybe you should have tried harder at school ! you’d be more capable in your chosen field then). It seems he is unable to reset/modify/delete/touch my incorrect entry on their system.

Problem. My email remains the same. Even if I buy a different oyster card, I will not be able to pair it up to my email address as it already exists in their system with bad values. I suppose I could create another email address to use, but why should I have to ? You don’t have to move house to get a problematic package delivered (praise for the postal service).

I’m going to assume I got an unhappy disgruntled employee who was pissed at having to work on a Saturday. I’ll call once again and see if I get someone helpful.

Otherwise I’ll need to create a new email just to register my oyster card. Hmmmmm, scott@tflsucksdonkeyballs.com has a ring to it, wonder if the domain name is free ?……..

For the love of god TFL, sort your site and train your staff, please !!!

Older And, Well Not Wiser As Such, But Know More Now Than Last Yeae

December 10th, 2010

Another years ticks over on my biological odometer. And what have I learned in the last 12 months ?

Never store numbers as strings in a database

The Danish language is really hard

My old gym was easier to get to

QNap ext3 file sytsem is a sodding patched non-standard implementation

My music collection is huge

Backups are good thing

Personal trainers at Fitness First are capable of speech, and not, in fact grumpy dumb mutes

Rather Impressive Storage…….

November 6th, 2010

And so it came to pass, the awesome Qnap TS209 Pro II that I purchased and lovingly installed last year, is almost full :o/

Admittedly, it only has 1TB of storage (x2 1TB drives, but I mirror them coz’ I’m paranoid and IT hates my flatmate). Now that they are becoming a little more common place on the market, I decided the most cost effective solution was going to be to replace the 1TB drive with 2TB drives.

However, the replacement process is not straightforward. Removing x1 1TB drive and replacing it with x1 2TB drive has resulted in the device rebuilding the data on the 2TB drive to re-establish the mirror, but rendering the remaining 1TB of space inaccessible :o(

So, I am going to have to transfer almost 1TB of data from the mirror set to an external drive, replace the other drive so the device contains x2 2TB drives, erase all data/partitions on them. Configure them as a RAID mirror, and copy all the data back onto them.

Time to complete……..well I started the data copy 2 days ago and it’s still going……I am hopeful that it may complete by the weekend ??! :os

I wish I had known about these guys at the time of purchase. From what I can gather, they are using a proprietary algorithm for data protection (beyondRAID) that seems to be rather dynamic ! It protects and shifts data between drives to accommodate a failure of any given drive. It also allows dynamic drive addition using mis-matched drive capacities, vendors, firmware etc.

I’m fairly certain my desire to purchase one is not being influenced in any way whatsoever by the demo being given buy the fit woman in the tight sweater. I need a backend network storage device for a project at work….wonder if I get them to buy a really big expensive one if the lady in the sweater comes to install it for you ? hmmmmmm?

:op

A New Taxonomy For Queens…….

September 27th, 2010

Reproduced with the kind permission of Hotpants of Kennington, who came up with the idea while out one night dancing…….clearly the music and the boys must have been very dull indeed !


All queens can be described by two adjectives, each of which describes their position on one or other axis of a two dimensional space.

The first adjective or dimension describes how well they carry it off. This is the Glamour dimension and ranges from Tragic to Diva.

The second adjective or dimension describes their attitude towards themselves. This is the Me scale and ranges from Painfully Modest to Totally Self-absorbed.

The two dimensional space created by these two axes can then be segmented into four quadrants by dividing each axis into two halves – Low and High. So we have…

High Glamour & High Me :

True Divas – we worship these people & with good reason. They are rare, but utterly fabulous.

Low Glamour & High Me :

Tragic Self-absorbed Queens – usually young & prissy with too much make-up & too many accessories. Sometimes they grow up & get over themselves, but more often they get hit by a bus because they aren’t paying attention.

High Glamour & Low Me :

Unassuming Adonises – hot, gorgeous, sexy & interesting in conversation, but at the same time endearingly down to earth. Ple-e-e-ease be my boyfriend…

Low Glamour & Low Me :

The Masses – most of us. Go out, get smashed, have a laugh & deal with the consequences tomorrow.

Bruce babe, you are a genius ;oD

Photo: GETTY IMAGES

Stew Stew Stew Stew…….

September 25th, 2010

Had some beef stew the other day when visiting with a friend. He gave me the recipe, but I didn’t write it down.

Tried recreating it the other day, pretty sure this isn’t accurate, but it tasted awesome (and just a tad more’ish, scoffed the lot with KrispyPig over a 2 day period :-/

Serves – x4 *really* hungry people (or x2 complete pigs for x2 days)

You will need :-

  • 2kg Stewing beef, roughly chopped (I just use x4 of the pre cut packs from Sainsburys)
  • 2 Packs streaky bacon
  • x2 Big onions (the bigs one that make you cry)
  • x3 or 4 Big carrots
  • x3 or 4 Big potatos
  • x2 Packs whole button mushrooms
  • Beef stock
  • Handful of rosemary
  • Handful of thyme
  • x1 Bottle of red wine
  • x2 teaspoons of sugar
  • Salt and pepper
  • x1 Big big cooking pot

Method :-

  1. Roughly chop the onions and fry them gently in the pan with the oil and a handful of rosemary and a handful of thyme
  2. Chop the bacon into small pieces
  3. When the onions are soft (but not mushy, about 5 mins should do it !) add the bacon to the pot
  4. Cook for 5 more mins till bacon is cooked, then add the beef to the pot
  5. Cook thoroughly adding salt and pepper to taste (about 10 mins)
  6. While beef is cooking, chop the carrots and potatoes into chunks (quite thick chunks, we don’t want them going mushy !)
  7. When beef is cooked, add potatoes, mushrooms and carrots to the pan
  8. Add enough beef stock to cover the contents of the pan
  9. Add the bottle of wine as well
  10. Add x2 teaspoons of sugar

Boil for about 5 mins, then reduce down to simmer and cook until the veg starts to soften (but stop cooking before it turns to mush !). Takes approx. 2 – 3 hours for me.

Serve with chunks of rustic bread.

Host Multiple WordPress Instances Using a Single Hosting Account

September 18th, 2010

Running multiple WordPress instances is easy when you have multiple databases and directories at your disposal, but often you only get x1 database and x1 hosting folder when you sign up with a web provider.

Here’s how to run multiple instances of WordPress from their own urls out of subfolders in your personal hosting space.

First, we need to create some MySQL users for assigning permissions to the database (I have created a fictional database ‘wpdb’ here). You could also do this using a GUI based tool like phpMyAdmin if you are more comfortale with that.

mysql> create database wpdb;
Query OK, 1 row affected (0.00 sec)

mysql> create user 'wp1'@'localhost' identified by 'wp1';
Query OK, 0 rows affected (0.00 sec)

mysql> create user 'wp2'@'localhost' identified by 'wp2';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on wpdb.* to 'wp1'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on wpdb.* to 'wp2'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Inside my web hosting folder I created x2 subfolders, ‘blog-one’ and ‘blog-two’, so my hosting directory looks like this

Next I download the latest version of WordPress from http://wordpress.org/latest.zip to my folder. Unzip the latest.zip file, it will expand the contents out into a ‘wordpress’ folder in the current directory.

Copy the contents of the ‘wordpress’ directory into the blog-one and blog-two folders.

Now go into the the blog-one folder and rename ‘wp-config-sample.php’ to ‘wp-config.php’.

Edit the ‘wp-config.php’. file with your favourite editor and set the following values:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wpdb');

/** MySQL database username */
define('DB_USER', 'wp1');

/** MySQL database password */
define('DB_PASSWORD', 'wp1');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix  = 'wp_1_';

Now go into the the blog-two folder and rename ‘wp-config-sample.php’ to ‘wp-config.php’.

Edit the ‘wp-config.php file with your favourite editor and set the following values:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wpdb');

/** MySQL database username */
define('DB_USER', 'wp2');

/** MySQL database password */
define('DB_PASSWORD', 'wp2');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix  = 'wp_two_';

What this will do is re-use the single database, but create uniquely named tables for each instance.

The url for my normal site is http://ubuntu.lan and here you can see the blog folders ready to use in my main folder.

I can access these WordPress instances by going to ‘http://ubuntu.lan/blog-one’ or ‘http://ubuntu.lan/blog-two’. But I don’t want my site url to be anything to do with these blogs, so we can use url rewriting to change them.

Create a .htaccess file with the following contents and place it into your root web hosting folder.

RewriteEngine On

RewriteCond %{HTTP_HOST} site2
RewriteCond %{REQUEST_URI} !^/blog-two
RewriteRule ^(.*)$ blog-two/$1 [L]

RewriteCond %{HTTP_HOST} site1
RewriteCond %{REQUEST_URI} !^/blog-one
RewriteRule ^(.*)$ blog-one/$1 [L]

This will allow me to use the url ‘http:/site1′ and ‘http:/site2′ to reach my blogs. Site1 and Site2 have the same ip address as my main site. When I type ‘http://site1′ into the browser, it goes to my web host and hits my default folder. There it finds the .htaccess file and reads it. It finds an entry matching ‘site1′ which tells it to go into the ‘blog-one’ folder for content. You can replace ‘site1′ for any url name you like, as long as the ip address points to your hosting server.

If you have edited ‘wp-config.php’ correctly, when you browse to http://site1, you should get the WordPress setup screen as shown below.

Fill in your values for site name, email contact etc. etc., the install will complete and you will be given the login details for the admin account.

You should now be able to logon to the site and it should look something like this.

Now you can repeat the steps for ‘http://site2′. If all goes well, you should have a second seperate blog site like below.

And if we look at the tables in our MySQL databse we see they all have wp_1_ and wp_two_ prefixes as shown below, isolating each site in the DB.

You can repeat this multiple times to suit your needs, as long as you can point the DNS for the url to your hosting server it should work fine.

Enjoy :o)

Remove Tilde From URL On OS X Personal Web Sites

August 14th, 2010

I’ve recently been helping a friend with some web site stuff. Nothing too complex, just some php that results in some html and css.

Continually ftp’ing the files back and forth to my ISP hosted account was becoming labour intensive, so I figured I would just use the apache web server built into OS X on my Mac Mini.

Some notes:

The main apache config file is located at:

/etc/apache2/httpd.conf

Each user has a personal apache config file that specifies the location of their personal web folder location. This file is located at:

/etc/apache2/users/<username>.conf

Each user/logon gets a folder called ‘Sites’ in their home location (so /Users/<user>/Sites/). This folder is the root folder of your personal web folder name space.

When you access the site, the url to use is:

http://servername/~username

If you don’t like the tilde character (~) being part of the url, you can get around it by editing the users personal apache config file. Add the following to the top of the file:

/etc/apache/user/<username>.conf

Restart apache (either from the Preferences panel, or with ‘apachectl restart’ and you should be good to go.

So my logon on my Mac Mini is Scott. The file I need to edit is:

/etc/apache2/users/Scott.conf

And I need to add the line:

Alias /Scott “/Users/Scott/Sites/”

I also add:

Alias /scott “/Users/Scott/Sites/”

So I don’t have to worry about case sensitivity. So now instead of using:

http://mymacmini/~Scott

you should be able to use:

http://mymacmini/scott

Kaspersky Anti Virus Policy Not Enforced…….

June 24th, 2010

Following the renewal of our Kaspersky anti virus products for another 12 months, the friendly sales person was also kind enough to point out that the license entitled us to upgrade to the lat[er|est] version, and that the new version supported Windows 7.

Sold !

We were previously running Administration Kit version 6 (6.0.1710) and were pushing out Anti Virus 6 for Workstation (6.0.3.837) to Vista desktops. That particular version of the client would not work under Windows 7, it would cause an exception and the process/service would shutdown (Windows kept going though, well done MS).

During a period of performance issues experienced last year, I had to dial back most of the Kaspersky features and functionality under Vista. The ‘Web Protect’ component increased some page load times to well over a minute if there were a lot of links on a page. And the ‘Proactive Defense’ component (which watches and protects the registry) would fire up so many alerts that just launching any approved application would result in so many popup alerts it resembled one of those naughty web sites with boobs all over them that hi-jack your screen with popups !

So all the components of the Anti Virus application were installed, but the Kaspersky policies were used to deactivate the bits causing problems. The only components left enabled were the ‘File Anti-Virus’ and the ‘Anti-Spy’ features. All the others components were unchecked.

I decided to create a new server instance and install the updated version cleanly onto it rather than upgrade the in place install. This gave me the luxury of migrating computers across to the new version in a more relaxed manner, and also leaving behind any bugs/isssues with the existing version on the old server.

So the new versions now in play are Administration Kit 8 (8.0.2090) and Anti Virus 6 for Workstation MP4 (6.0.4.1424). I have no idea what the MP4 stands for (if anything).

This time, I decided to save time and resources, I would only install the anti virus package components we wished to use, namely file and spyware scanning. So I attempted to modify the package as shown below

av package components

However, it became apparent that when the application was pushed out to the client something was not quite right. No matter what I tried, the policy for the workstation was not being applied. I tried removing and re-installing the AV client, but it did not change anything. Many google searches later did not return anything definative or useful (hence my writing this blog post, maybe someone else also tried to save a bit of disk space and found that their policies no longer worked !?!?).

So I went back to defaults and put all the components back into the package and re-deployed to the workstation. This had the effect that the policy was now being detected and applied to the workstation ?!? So now I just go in and modify the policy to deatcivate the protection components I am not using as per the previous version.

av component configuration

Happy to report that the new MP4 version of the AV client works fine under Windows 7 for both x64 and x86 bit, as well as Vista. CPU and memory utilisation would appear to be greatly reduced (the avp.exe process on my workstation is using a little under 17MB).

I am a little miffed that I had to install all the package components onto the workstation in order for policies to work (especially as I then just use those policies to deactivate over 75% of the products features !).

In summary, if you are having trouble with Kaspersky policies not being applied to AV workstation clients, check to see if you removed any of the components from the deployment package, it may be a factor.

Powershell Log File Zipper…….

June 23rd, 2010

Another annoying repetitive task automated ! Ahhhhhhh :o)

The log files for our IIS servers build up over a couple of months and consume disk space to the point of becoming an issue. I had been manually logging on and creating a .zip file for each month and then dragging the individual files into the zip file.

Tedious and repetitive, just the sort of thing scripting was made for. Typicaly my scripts for Windows are in vbscript, but this time I decided it was time to look at powershell.

The logic was simple enough. First create a zip file for the previous month. The logfile names are in the format ‘u_ex.log’ where mm is the numerical month. I needed to get the current month, subtract one (compressing previous months logs) and then move any file with a mm figure that matched into the .zip file.

I found this article for creating the actual zip file itself. Then is was just a case of setting the paths and looping through each file in the directory (get-childitem makes this a breeze).

Debugging the script was a bit of a pain in the arse using the built in Windows tools, so I downloaded and installed PowerShell GUI from here. It’s still a work in progress in some respects, the built in intellisense isn’t 100% there just yet, but it does allow you to step through code and what the vaule of your variables and figure out what is happening.

Once I had the script working of the command line, it was just a case of scheduling the job to run on the 1st day of each month recurring. However, this proved to be almost as big a task as the script itself.

For some reason, running powershell.exe and passing the script to it as an argument, ever using the full -command “$ syntax failed to execute the script. In the end I had to create a batch/.cmd file and place the powershell command in there and schedule the batch file to run instead.

My only gripe is that the command to move the file into the zip file is asynchronus so I had to include a sleep/wait period to give the file time to be compressed before being moved into the .zip file. That being said, there will never be more the x31 files, and allowing x2 mins for each file to compress (extremely generous) means the script should never take more than x1 hour to complete, so as long as I run it during a quiet period it should not impact anything else.

I eagerly await the 1st of July to see if the scheduled job kicks in automatically on the live evironment……:o/

#declare functions here
function new-zipfile {
	param ($zipfile)
	if (! $zipfile.endswith('.zip')) {$zipfile += '.zip'}
	set-content $zipfile ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
	(dir $zipfile).IsReadOnly = $false
}

#define variables here
#some strings and numbers we will need
$thismonthint = get-date -f "MM"
$prevmonthint = (get-date).addmonths(-1).tostring("MM")

$thismonthstr = get-date -f "MMM"
$prevmonthstr = (get-date).addmonths(-1).tostring("MMM")

$thisyearlongint = get-date -f "yyyy"
$thisyearshortint = get-date -f "yy"

$thislogdir = 'C:\weblogs\'
$thiszipfile = $thislogdir + $prevmonthstr + $thisyearlongint + '.zip'
$zipexists = test-path $thiszipfile

#start program here
#first pass, check for .zip files of previous months. if exists exit. if not exist, create empty .zip file
if (! $zipexists)
{
	echo 'zip file does not exist, creating zip file'
	new-zipfile $thiszipfile
}
else
{
	return
}

# move all log files where the month number matches the month number of the .zip file
# Jan = 01, Feb = 02, Mar =03 etc. etc.

foreach ($file in Get-ChildItem $thislogdir)
{
	# exclude the .zip files already in the directory (just in case we get a random month match in their filename
	if (! $file.name.endswith(".zip"))
	{
		# if the
		if ($file.Name.substring(6,2) -match $prevmonthint)
		{
			$zipfile = (New-Object -ComObject shell.application).NameSpace($thiszipfile)
			$zipfile.MoveHere($file.fullname)
			Start-Sleep -Seconds 120
		}
	}
}

squish !!