How to make your WordPress Theme wider

Here’s the steps to make your WordPress default (Kubrick) theme wider.

For me I made it 200 pixels wider.

So for functions.php add 200 to each of the highlighted rows

functions.php
functions.php

In rtl.css add 200 also

rtl.css
rtl.css

In style.css add 200 to all but the #commentform input which I added only 100

style.css 1
style.css 1
style.css 2
style.css 2

Then images\\header-img.php add 200 to each value

header-img_php
header-img_php

Lastly make the following pictures 200 pixels wider images\\kubrickbgwide.jpg, images\\kubrickfooter.jpg and images\\kubrickheader.jpg

I did this in Paint.Net by creating a new picture the same size as each one, pasting in the picture left justified then cutting from the source image the right 60% of the image and pasting that over the right edge of the picture giving a wider final picture.

Zoom helped for aligning the pictures. Also be careful when you export the pictures as the compression settings have a lot of effect of size of the images.

IDA Script: Remove empty auto labels

When working in IDA to reverse games, you can end up with lots of dummy/empty labels, that are auto generated when doing offset work. Here’s my script to remove them.

First how it happens.

You find a value you are interested in setting to a offset

Value in IDA
Value in IDA

And then you right click and go down the offset menu, and review the choices.

Ida - Value as Offset
Ida - Value as Offset

This just created a dummy label on every segment at offset 32h so it could display it to you.

IDA - Unreferenced Labels
IDA - Unreferenced Labels

Now you can remove these manually by selecting the line and pressing n then empting the name, and pressing ok.

IDA - Set Label as Blank
IDA - Set Label as Blank

But that’s painful if you have hundreds of dummy labels. Roll on the power of IDC files, and lets get rid of those.

#include <idc.idc>

static main()
{
  auto seg, loc, flags;
  auto count;

  count = 0;

  seg = FirstSeg();

  while(seg != BADADDR )
  {
    loc = SegStart(seg);
    while( loc < SegEnd(seg) )
    {
      flags = GetFlags(loc);

      // Has a dummy label and no references, and not start of function, remove name
      if( ((flags & ( FF_LABL | FF_REF)) == FF_LABL) & ((flags & FF_FUNC) == 0))
      {
        MakeNameEx(loc, "", 0);
        count ++;
      }

      loc = loc + ItemSize(loc);
    }

    seg = NextSeg(seg);
  }

  Message("Removed %d empty labels\\n", count);
}

Now you can safely remove the non referenced auto labels. It leaves functions names, or those that don’t follow the auto label format loc_xxxxxx

Mine Site Visits

Last week I was out in the field.

Firstly I spent two days getting my MSHA training, then spent two days on actual gold mines. Plus two days travel time.

Here’s a nondescript photo, from about 5000ft.

mine site
mine site

It’s was very interesting to see our products in use, hear from actual users, and resolve some issues.

We watched the daily blast, that was very cool, it took 5+ seconds for the sound to catch visuals.

We now have cars!

Yesterday we purchased two cars:

2009 Nissan Sentra

2009 Nissan Sentra
2009 Nissan Sentra

and a 2009 Ford Focus SE

Ford Focus SE
Ford Focus SE

Both low miles, and good condition (I think), here’s hoping to a few years of trouble free motoring in the USA.

Any bets on which will falter first?

What's Simeon been up to?

Well thanks for asking. But only because you asked, I’ll give you the short answer, because trust me, I know your busy, and I really appreciate you dropping by.

So we flew from New Zealand to Peoria, Illinois, USA, landed in some of the colder weather they have had. Not the coldest, but an aeroplane did slide off the end of the runway and go into the ditch on the morning of our arrival. Our bags also were “delayed’

Our temporary housing is in a not so nice B grade apartment complex, we can hear the people above’s every move, even their talking at times, but not what they are saying. Also noted on that, was that from the hallway you can hear everything that anybody on the floor is saying. Interesting experience there.

We looked at a few houses, not many to rent in the area’s we wanted to live. There are quite a few houses for sale, but we are not ready to commit that much to this location (yet). So we are renting a house bigger than we need, but it’s nice, and a nice area with a nice school.

The kids started school on Thursday last week, which was as good for them as Michaela. There was a little bit of cabin fever going on.

We have been shopping for lots of house hold things, spending large amounts in shops to find specials on the next day or two. Slightly maddening, and yes some places will retrospectively give discounts, but not all. Really it’s just annoying to be spending so much money in a short time period, and knowing you can’t get the best time to buy discounts…

Which bring us to the Social Security Number, which we needed to wait before applying, which means three weeks into the adventure we/I don’t have it yet, but nearly everything needs/wants it. Which means important things have to wait. So frustrating.

Oh, and things are beyond crazy busy at work.. and there is so much US HR paperwork to compete, and it’s all made harder by the fact I’m not stationed at a Trimble location.

It can only get better.

Recovering from a corrupted Windows Registry

This is a post about how I recovered from my corrupted Windows Registry. I’ll be the first person to admit that I’m the person that also corrupted said registry.

I ruined my registry the normal way, delete registry key chunks with Regedit.

I had installed Oracle 11 directly onto my development laptop to perform benchmark testing of some performance improvements that were planned to be developed. But that was months ago, and that project got lost of the prioritisation list almost as soon as it was added. Full Oracle 11 does not have an uninstaller, which seems like a crime to me, but I guess they think if your going to all that effort to install it, you most likely want to use it. Which for businesses this makes a lot of sense, except when you want to tinker and experiment, and as it’s free for developers, they are the most likely to be the tinkering group, but as they are the only ones likely to want an uninstall and they paid nothing there is not much ROI on developing an uninstaller.

So I was getting rid of Oracle the nip ‘n’ tuck method, but I got bored, and just started cut ‘n’ slashing. There were only one set of edits that were dubious, that was trying to delete a node called Session Manager.

Turns out that you get an error message half way through deleting the key/node, and you are not allowed to delete that!, but you have also lost some of the values/keys.

In hindsight, this would have been a good point to run System Restore, to fix my mistake, before rebooting….

But I rebooted, and the machine then BSOD under all boot methods.

Googling for the error message gave me some good solutions, one being the excellent KB 307545 How to recover from a corrupted registry that prevents Windows XP from starting.

Only problem I had no install media, and I was at located at different company on the other side of the planet from my IS department.

I Tried booting my Dell Latitiude E6400 from genuine Windows XP Pro media (found by driving 30minute to a different work location), but that also BSOD (but different type).

Built an USB bootable XP Recovery Console but it could not see my internal hard drive.

Finally got in touch with the New Zealand IS team once they come on-line and initially got the “oh that’s nasty, sounds like your hosed“ response, but was place in queue for the time with the chief/grumpy IS head dude/wizard to call me back.

Luckily he had solved this before, and pointed me to the above mentioned KB article, but added “you will have to use Dell install media to boot into Recovery Console, as that will have the needed Dell driver built in“.

Meanwhile the host companies IS team got back to me with the “oh that’s nasty, sounds like your hosed“ answer, but they agreed to  tried all their magic boot CDs and things where still “oh that’s nasty, yip, your hosed“. I begged for a Dell disk, and with much disdain it was tried, and you know what, it worked. He miss-followed the above instructions, and repeated the IS mantra “oh that’s nasty, yip, your hosed“ when it didn’t work. But he did burn me a copy of the media, and said “your welcome to try it yourself“.

Which I did, and step by step, rebuilt my registry, thus got my machine back up and running.

Only 24 hours of down time.

We are in the middle of the craziest crunch I’ve seen over the last four years of working for this team, so timing wise this was bad.

I’m very glad it’s over really.

I still have Oracle installed, but for now I’ve disabled all the services and will leave it alone, it can wait till a controlled repave.

I also think I’ll invest in a external back-up process, as I’m now off-site and on my own, not really wanting to have to ship my lappy off to have it repaved and lose all my data/etc. I had been quite use to being cavalier with my PC because the on-site IS team were great, and things could get fix quickly, but now I may have to be a little more cautious now I’m flying solo.

Overall I am very impressed with the recovery tools built into XP, and while they are a little voodoo, I’m glad they are there, and well documented. I just hope I never have to use them again.

Some iPhone apps are fat little piggies

As part of my last day tidy-up, I was deleting stuff, and I noticed just how big some iPhone games were:

Game

Size (MB)

Free Play Time (m)

Size/Minute

Assassins Creed Lite

99

10

9.900

Hero Of Sparta Lite

42

25

1.680

Hungry Dragon

25.7

10

2.570

Undercroft Lite

11.4

120

0.095

Hungry Dragon each game only last ~10 minutes, but you can play as many games as you want and the graphics are the same for the whole time.

My point is, that not all games are equal, yes the the first two are very flashy, but for the amount of game play you get they are quite big. Hungry Dragon, really is a simple game, there’s not much to it, but it’s a fat little application, where as Undercroft Lite is a very polished and complete game, giving ~2 hours of game play. The full version is only 16.2 MB (42% bigger)  and I’ve played for over 13 hours so far.

Not sure if I have some moral insight, just pointing at the fatties, and call a spade a spade.

Five+ years of Gmail

Today while unsubscribing from NZ mailing lists and deleting old cruff, I went and found my oldest sent Gmail message, sent 26 August 2004, so I’ve been a very happy Gmail user all that time, and it’s better than I originally told my wife:

It’s easy to check from home and work, and I never have to delete any
email because I can store 1gig’s worth of stuff.

I current have 440MB of 7414MB, so all this time I’ve never had more that 5% usage.

Yes Google know lots about me, but it’s been useful. We have changed ISP three times in that period, and I’ve had three different work places, but one email the whole time.

Cheers Google.