Windows PowerShell

Windows PowerShell

Microsoft Windows PowerShell command line shell and scripting language helps IT Professionals achieve greater productivity. Using a new admin-focused scripting language, more than 130 standard command line tools, and consistent syntax and utilities, Windows PowerShell allows IT Professionals to more easily control system administration and accelerate automation. Windows PowerShell is easy to adopt, learn, and use, because it works with your existing IT infrastructure and existing script investments, and because it runs on Windows XP, Windows Vista, Windows Server 2003 and Windows Server “Longhorn”. Exchange Server 2007, System Center Operations Manager 2007, System Center Data Protection Manager V2, and System Center Virtual Machine Manager leverage Windows PowerShell to improve efficiency and productivity.

MySQL stored procedure variables

A few months ago we wrote a mammoth we application which had an SQL Express DB. We used stored procedures, and after writing 170 of them(I didn’t write all of them of course), I was quite used to the way that variables and so on worked in SQL Server.

We’ve started a new project where the DB is MySQL 5. Again we are using stored procedures, but variables work differently.

Setting a variable in SQL Server

DECLARE @oldPageGUID uniqueidentifier;
SET @oldPageGUID = (SELECT mPage.id FROM mPage WHERE mPage.title = @passedtitle);

Setting a variable in MySQL Server

DECLARE dateAdded TIMESTAMP;
SELECT lusers.dateadded INTO dateAdded FROM lusers WHERE lusers.id= id;

You can see that setting the value of the variable is done completely differently (MySQL Docs for SELECT … INTO Statement). Two other things that confused me for a while was that there is no character prefixed to the variables in MySQL as in SQL server (@) and that there is no uniqueidentifier data-type for GUIDs

Testing Aer Arran

Aer arran Logo
Last weekend I went to see my dad near Galway. This time I didn’t fly with my beloved Ryanair to Shannon but with Aer Arran direct to galway from Manchester. It’s a small ariline with small planes so I was hopeful to have a quick and trouble free trip. I did, apart from a 20 minute delay in Manchester on friday night (which is understandable) and a silly bitch on check in that made me check my small rucksack in instead of taking it on board. I quoted the size restriction from the website and that the bag was within those limits. Silly tart was having none of it. Some battles are not worth fighting though. All in all Aer arran scores 8 out of 10. From my Dads house to my office took only 4 and a half hours – amazing.

Going to the Linux World conference – NOT

I was very interested in going to Linux World this year. There were quite a few speakers and presentations I thought would be very interesting. I had hinted to my boss that I wanted to go but as we are currently a microsoft house, it was not really going to happen.

I figured I could do the whole thing myself for under GBP200 including train and YHA accommodation. I’d researched which YHAs had availability and found the train I was going to take.

There I was, watching TV with Gill, with my iBook on my knee ready to book the train when I called the YHA just to confirm they had a single room. Suddenly, I get a swift kick to the shin, WTF. I ended the call to see Gill giving me evils (a common occurrence I’m afraid), but why this time. I hadn’t got a clue. The day I was planning to go was only her bloody birthday. Doh! Doh! Doh!. So alas there was some apologising, and some postponement of Linux World. Maybe next year.

instLux saved my bacon

instLux, installing linux on a machine with no cd or floppy drive

I was very bored of my toshiba libretto L5 as WinXP was getting crazy slow on it so I never bothered to use it. I wanted to put Ubuntu on it but the live cd or the install would not recognise the PCMCIA cd rom I have.

Then I found instLux which installs a mini Grub onto your windows partition which you boot into. There are 4 versions of instLux, two for Ubuntu and two for OpenSuse. Each distro has a Net install and a CD ROM install version. I tried the CD ROM version first but it couldn’t find the CD rom either.

I booted back into windows and installed the Ubuntu Net install version of instLux. At first attempt, it fried my hard disk after stalling at 6% of install. A quick Win XP reinstall, reboot and retry was successful. I now have Ubuntu 6.06 installed with a very quick gnome theme with all icons turned off. Epiphany is super quick and will be my browser of choice on this machine (I haven’t installed Galeon yet though and Dillo is just minging). I did try to upgrade to Edgy Eft but it failed and after the hassles with the upgrade on my iBook (X wouldn’t start untill I managed to install the ATI drivers again), I’m not going to try again.  It’s a joy to use the machine again.

I’ve had a few freezes and hard reboots but it’s a hell of a lot faster than clunky win XP.

Ultimate dev laptop

I’ve been looking around at laptops for a while. I want the ultimate laptop.

  1. I want Core 2 Duo or similar AMD
  2. At least 2GB RAM
  3. A fast hard drive (7200rpm)
  4. Dual display out, DVI and VGA
  5. Ability to run 2 external 20″ monitors
  6. At least 15.4″ monitor
  7. Very good build quality
  8. DVD writer
  9. Onboard Wifi
  10. Optional: Bluetooth
  11. Optional: Card reader

Does anybody know of such a laptop that has had good reviews. I’ve looked at Asus, Acer, Rock, Alienware, Evesham, AJP and Dell. Each of them falls down on at least one of the above. I’ve been weighing up whether to push for a laptop in work or to bite the bullet and buy one myself. If I found the right one, I would have no hesitation paying GBP1500 of my own cash. The amount of time I spend on it, it’d be stupid not to. At the moment, the front runner is the Dell XPS m1710 but it tops out at GBP2000 which is a bit too much.
I need all suggestions, so please comment 🙂

Multiple instances of jEdit

I am a complete jEdit fanatic and it always has a place on my taskbar. jEdit is ver clever when running multiple versions each instance communicates over TCP IP so that all instances are identical. What if you don’t want that and want to have different file open in different instances of jEdit (or if you were using something like GoScreen). By default the shortcut for jEdit is something like:

“C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe” -jar “C:\Program Files\jEdit\jedit.jar”

But to stop the instances communicating to each other you need to use a “-noserver” switch:

“C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe” -jar “C:\Program Files\jEdit\jedit.jar” -noserver

I found the above in the wonderful jEdit userguide, chapter “starting jEdit“.

W3C Log File format on IIS- UTC timestamp

We were trying to check the log files for a site of ours to make sure a rewrite rule was working. Due to lack of rotation, the log file was 3GB and would not open in textpad (understandably). What a I really needed was a win32 version of tail. Voila – tailforwin32.sourceforge.net. It’s a GUI to view the last few lines of a file. It changes as lines are added to the file so you can view error or server logs in real time. Great we can check if the rewrite rules are working now. But is the last entry in the log file always exactly one hour ago.

2006-09-18 13:47:04 GET /Default.aspx – – 84.92.72.226 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322) – 200 8307

After some research on W3C Log file formats (microsoft article), it turns out that it is the UTC time that is logged, not the LocalTime of the server. And since we are currently using daylight saving time (from March to October), which is UTC+1, which means that the UTC time of an entry in the log file looks like it’s an hour behind (from March to October anyway).

Mystery solved

And yes we have rotated the log files now.