Archive for July, 2006

July 20th 2006

Foo.

Something I learned today..

Windows XP’s explorer doesn’t appear support long path names (ie. paths over MAX_PATH, 260 characters long), neither do the GnuWin32 utils.

This is a major pain, if, for some strange reason (don’t ask) you happen to have accidentially created a large number of folders called “foo”, each being a child of the next.. you can’t delete or browse them, the only operation that works is move (rename).

Simple solution; run the following a few times:

for /F "usebackq" %f in (`seq 1 500`) do mv foo foo2 & mv foo2\foo . & rm -r foo2

Oh, such a nasty hack.

For anyone who doesn’t have a clue what’s going on there, all it does is (500 times):
Rename ‘foo’ to ‘foo2′.
Move ‘foo2′’s first child to the current directory.
Delete (the now empty) ‘foo2′.

Simple, eh?

No Comments yet »

July 13th 2006

Kensington locks

At IBM, due to the sheer number of Thinkpads lyring around on desks, all laptops are supposed to be secured to the owner’s desk using a Kensington MicroSaver, simply to stop people walking in and grabbing a pile of laptops.

The first hit on Google for “Kensington lock” was, t the time of writing, a Digg post about picking Kensington locks, the essence of which is: Cardboard tube with the same diamter of the lock and some jiggling.

My ‘lockpick’, fashioned from a pencil, a few bits of scrap paper and some sellotape (all of which were lying around on my desk at the time):

With this, and about 5 minutes trying to get the technique right, I managed to get the lock off my laptop.. repeat attempt (knowing which way to ‘lean’, which you can work out easiest by looking at the key, but that’s cheating, of course..) took about 30 seconds to get the lock off.

So much for not being able to just grab them off desks..

1 Comment »

July 8th 2006

Boredom

Following the CompSoc BFL 2006 and a week at home, I’ve moved to the Southampton area for my IT year at IBM Hursley.

Not having had an internet connection for most of that time, I’ve had to come up with some other things to do (besides watching QI).

First, anyone who’s used GnuWin32’s CoreUtils’ ls will probably have noticed how slow it was (for example, it takes ~4 seconds to list the files on my desktop); it also lacks actual checking of the owner/group of the file, the permissions and the colouring/console-width-awareness provided on other platforms. I can (now) appreciate the permissions, but the others.. Anyway, I decided to rewrite it. Going reasonably well, but reading the permissions (for anyone but the current user) is a pain. A serious pain.. if I ever manage to do it successfully, I’ll probably write about it. As far as I can tell, nobody else has ever managed it, so things aren’t looking good.

It’s not ready for general use yet, but it’s definitely working:

Secondly, having seen both Silver’s ConResMgr (a tool that lets you drag-resize Windows Command Prompt windows), and the way he lays out windows on his screen, I thought I’d have a go at doing it semi-automatically.

The result was the imaginitively ‘FauWM Assistant’, which, when you Ctrl+drag or Ctrl+resize windows will show a dialog prompting you for which sextant(s) of which screen(s) you’d like the window to be placed in.

The result is that it’s very easy to get a window setup that looks something like:

The (ultimately sexy) prompt for window position currently looks like:

So, to use:

  • Grab (pretty much) any window by the title bar, I know it doesn’t work with Winamp and (partially) Putty.
  • Hold control and just drop the window anywhere; the Segment Select.. window shown above will come up under your cursor.
  • Drag a box through some of the rectangles shown.
  • The window should now be where you wanted it.

You can download FauWM Assistant (sig), it needs the Visual Studio 2005 (8) Runtime Library.

No Comments yet »