Aug 18

List all base tables in a DB2 database

-- List DB2 base Tables
select sit.TABLE_NAME, sit.TABLE_TYPE, substr(sit.TABLE_NAME,2,instr(sit.TABLE_NAME,'_')-2) as SYSTEM, sct.COLCOUNT, sct.CARD as ROWCOUNT
inner join syscat.TABLES sct on sct.TABSCHEMA = sit.TABLE_SCHEMA and sct.TABNAME = sit.TABLE_NAME

Aug 18

List unreferenced tables in a DB2 database

-- List DB2 base tables which don't have References
SELECT sit.TABLE_NAME, 'No References'
left outer join syscat.REFERENCES ref1 on ref1.tabschema = sit.TABLE_SCHEMA and ref1.tabname = sit.TABLE_NAME
left outer join syscat.REFERENCES ref2 on ref2.reftabschema = sit.TABLE_SCHEMA and ref2.reftabname = sit.TABLE_NAME
where ref1.constname is null
and ref2.constname is null

May 29

Installing notepadqq on Debian-based Linux

sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq

Jan 09

Making a replacement lathe leadscrew nut

My milling machine has a #3 Morse Taper spindle. I’ve spent a few days making #3 Morse Taper arbors from steel, which I’ll use to make various tools for my mill.


Unfortunately this took a toll on my lathe’s topslide screw nut. That little bronze coil spring is actually the threads from inside the nut.


After doing a little research I found that acetal plastic is just as strong as bronze for this kind of application, and much easier to make into a nut. The simplest way to do this is through compression molding.

Here I’m drilling a hole through a piece of steel shaft to make the main body of the mold.


Progressively boring out the hole to 20mm


The original bronze nut fits inside, so it’s looking good.


Next I drilled a 12mm hole through the side of the mold.


This allows the leadscrew to be fed through the mold and plastic blank.


Next, a section of acetal plastic is machined to 20mm diameter and inserted into the mold. The mold is used as a template to drill the initial hole through the plastic.


The plastic makes some impressive swarf.


The mold and the drilled plastic blank.


The plastic blank is sawed to length, and two 20mm diameter spacer plugs are machined from steel. These will apply even pressure to both the top and bottom of the mold, to prevent any possible bending of the leadscrew.


The leadscrew is dusted with graphite powder to make it easier to unscrew when the pressing is finished.


All set up, ready to apply pressure. The 6-tonne press is overkill for this task, but I’ve heard that if you don’t use your tools your wife may be inclined to ask questions about why you need them.


Heating the mold and leadscrew with a heat gun. Since we’re applying a couple of tonnes of pressure it isn’t necessary to heat the mold to the melting point of the plastic, we just need to soften it enough to retain a good impression of the leadscrew threads.




The thread impressions look pretty good for a first try.


Pressing the completed nut out of the mold.


New nut fitted to the compound slide.


Threading the compound slide leadscrew back into place.


The nut was a little tight, but unlike the original bronze nut has no detectable backlash. It smoothed out nicely after being run to and fro a few times. I made sure to make two nuts while I had the equipment set up, so I’ll be ready if it fails again. :-)

Dec 06

Windows Symbolic Links

C:\>mklink /?
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file
symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction.
Link specifies the new symbolic link name.
Target specifies the path (relative or absolute) that the new link
refers to.

Oct 09

All-terrain Mobility Scooter, Part 4

Shortly after this photo was taken, Pete said “Here, hold my beer and watch this!”

The first test run of the drivetrain, with the wheels up on blocks and running at half power (12V). I needed the sprocket drives for two reasons:
(a) The axles coming out of the motors weren’t nearly strong enough to carry those big wheels, and
(b) I needed to reduce the gearing by a 2:3 ratio. The motor sprockets have 12 teeth and the wheel sprockets have 18.

The steering had a lot of play in it, so I’ve decided to fit 2 bearing blocks to the steering column instead of 1. Here I’m using a 20mm end mill to square up a slab of plastic to make the pillow block.

The old (very worn) pillow block bearing on the left, the raw blanks for new ones on the right.

The two blanks with their bearing and mounting holes drilled.

Roughly cut out on the bandsaw. My bandsaw cuts tend to “wander” quite a bit, so I tidied them up on the mill before splitting each bearing into its 2 halves.

That extension loop holding up the top bearing was formerly the rear subframe of the donor quad bike. The pink painted pieces of steel came from a scrapped 2-wheeled hand trolley.

Steering sorted, and temporary floor in place. I’ll be moving on to battery boxes and motor controllers tomorrow.

Sep 29

All-terrain Mobility Scooter, Part 3

Brackets constructed for axle housings, clamped up ready for welding.

Axle housings and mounting plates. The axle housing on the left is upside down to show the construction.

This is probably massively over-engineered, but I reckon it’s better to have a kilo too much chassis than a single gram too little. The loops leaning against the cabinet to the left will be attached tomorrow to form the seat brackets.

We’re not going to use this seat any more, but it’s still useful for working out ergonomics.

Detail view of the rear axles. The inner disks will (eventually) get machined into roller-chain sprockets.

More new tools, which were deemed to be critical to the construction of this project. :-)

Using my new rotary table to drill the holes for the first motor drive sprocket. The rotary table lets me accurately rotate the workpiece to make sprockets with any number of teeth.

Now I’ve switched to an 8mm end mill to finish off the tooth profiles. I end up going around the circle 3 times: once for drilling, once for the leading tooth edge, and once for the trailing tooth edge.

After some minor finishing with a file, it seems to be a good fit for the 420 chain which came from the donor quad bike. Considering that it’s the first one I’ve ever made, I’m satisfied with the finish.

Sep 29

All-terrain Mobility Scooter, Part 2

I’m using some thick-walled steel pipe to make the bearing housings for the rear axles. My chop saw doesn’t cut perfectly squarely, and it tends to leave swarf behind on the cut.

Same housing, with the swarf filed off. The axle is only going to be 17mm diameter, so the housings will extend all the way out to the road wheel hubs to provide the maximum possible support.

Unfortunately I don’t have a conical insert for my live centre that’s big enough to fit this pipe, so I’ve made a plug to use instead.

The plug is inserted on the tailstock end of the pipe, supporting the whole tube while I machine a bearing surface for the steady rest jaws to run in.

Steady rest fitted, and tube faced off. I’ll start boring out the recess for the bearings tomorrow.
I would have preferred to use 25mm internal diameter bearings, but my steady rest won’t hold a piece of pipe that big.

…and that’s what they look like once the rebate has been machined and the bearing is inserted.

I’m going to use some sections of an old barbell bar for the axles. These start out at 25mm diameter, so I’ll machine off 1mm or so to clean up the rust and remove the knurling.

It’s one long cut between the chuck and the live centre, then reverse the workpiece to finish off the end that’s in the chuck.

Pretty much any old bit of steel will clean up nicely. The axles next need to have their ends machined down to the inner diameter of the bearings, but I’ll leave that for another night.

Here I’ve rough-machined the axles to within about 0.5mm of their finished diameter.

The next day, and the end rebates have been finished off to exactly fit the bearings.

Two axle housings with bearings fitted. These just need hubs on either end and mounting brackets welded on, and they’re done.

The road wheels need to have their wheel studs on a 90mm diameter circle, so I’m making a suitable flange for the hub. Here I’m drilling the centre out to 25mm.

Two wheel hub flanges ready for mounting on their hubs.

That’s the roughed-out axle hub. As you can see from the flange above it, I still need to take another 10mm off the diameter so that the flange will fit on.

…like this!

Now I’m clamping the hub and flange together, ready for welding.

If I could go back in time 4 hours or so, I’d advise myself not to weld this side. These welds just needed to be machined off again, and the weld metal is much harder than mild steel.

Completed hub blank, from the inside of the wheel.

View of the hub blank from the outside of the wheel. The wheel is centred by the hub spigot, the bolts are just there to hold it on (i.e. the bolts shouldn’t carry any load in the vertical plane).

The hubs need to be accurately bored to 17mm to fit precisely on the axles. I’ve used a 15mm drill bit to get this one close to final size, and I’ll finish it off using the boring bar tomorrow.

Axle housing assembled, now they just need keyways so that the hubs can be power-driven.

Drilling the wheel stud holes in the road-wheel hubs.

Practicing my milling technique using some scrap material. The drill press vice wasn’t rigid enough, so I’ll look at using a different method hold the workpiece.

These new toys arrived today. When you buy a machine tool (like a lathe or a mill), what you’re really doing is making your first down-payment on a lifetime of purchasing cutting bits and accessories.

About to start the first keyway cut on the Real Thing. I’ve mounted the axle in v-blocks for stability, but I really do need to invest in some better hold-down clamps at some point.

That’s a nice clean cut.

And the key steel fits perfectly! Huzzah!

Welding the sprocket blank (bottom) to its hub. I would have preferred to bolt it, but there just wasn’t enough “meat” left in the hub to do so.

Set up to scrape out the keyway slot in the hub. I’ll probably discover tomorrow that my lathe has a built-in spindle lock, and that the clamps were totally unnecessary.

Both axles are now fitted with keyways and keys at each end. Just a little more work and we’ll be ready for Billycart Testing!

Sep 29

All-terrain Mobility Scooter, Part 1

A few months ago I decided to build an all-terrain mobility scooter for a handicapped friend. This blog series will show the machine taking shape.

This is an Ortho-Kinetics Triumph Model 4390 mobility scooter, circa 1990. This works OK for Pete, but isn’t too good over boggy or bumpy ground in the paddock. I bought two of them as a cheap package deal (neither of them were working).

By the time I purchased the scooters all of their electronics were non-functional, so this one has been adapted to use a $20 eBay motor controller.

This children’s quad bike (with dead engine) is going to supply most of the parts needed to build an all-terrain mobility scooter.

Here’s the first “trial fit” of the layout, using the seat from the second Triumph scooter. I’ve used a plank of wood and some clamps to see how high we can raise the handlebars.

A side view, with the steering at full lock.

Side view, steering straight ahead.

These two drive motors have come from another donor scooter with dead electronics (this time a mid-1990s Fisher & Paykel)

We’ll be driving each rear wheel with its own motor, 200 watts per wheel.

Here I’ve cut the front end off the quad bike, and tilted the steering column back to give an easier reach to the handlebars.

A view with the front wishbones and hubs refitted. This quad had mechanical drum brakes on the front wheels, which will come in handy. We’ve also used the quill stem from a children’s BMX bike to get some adjustability.

Full right steering lock.

Closer view of the front suspension assembly. The new extended steering column is a different diameter to the original, so I made a “splicing plug” on the lathe to bolt the two together. This will also allow us to dismount the handlebars if this machine ever needs to be transported in a vehicle without much vertical space (i.e. a Toyota Corolla station wagon).

I had to cut and re-weld the steering pivot to tilt the steering column.

An assortment of useful pieces from the scrap dealer, and some 5mm thick disk blanks from the steel shop. The disks are usually welded to fence post tops as caps, but I’ll be cutting them into sprockets for the chain driven rear wheels.

A solid rear axle like this has to spin the “inside” rear wheel on tight corners. I’ll be cutting this one into two stub axles, and driving each rear wheel with its own electric motor.

Checking the layout. The final chassis will use 4 parallel 25x1mm steel tubes, with a topping of aluminium tread plate. I’ll add triangulation bracing to the high-stress areas. The turning circle won’t be as good a a 3-wheeled mobility scooter, but that shouldn’t matter because this one isn’t intended for indoor use.

The two “inside” chassis rails are a different diameter to the existing quad bike frame, so I’ve made some adaptor plugs to bridge them.

The adaptor plugs are hammered into the ands of the existing frame (they’re a “snug friction fit”).

I’m also slipping a piece of intermediate-sized tube over the skinny quad bike frame tube.

All welded up. I drilled 10mm holes in the chassis rail tubes so that I could weld through into the adaptor plug.

The frame bracing will be made from these old 1980s chairs. These were the high-quality “made in Italy” variety.

The chair frame is made from a single piece of thick-walled 25mm steel tube, with lots of useful 90-degree bends.

Squeezing the end of a tube to make it easier to weld onto the chassis rail.

This was a little optimistic of me, but it would have been much quicker to construct.

Unfortunately I didn’t take either steering lock or suspension compression into account.

90 minutes later, all better.

Assembling the outer chassis rails parallel to the inner ones.

Back outside the shed for an ergonomics and component fit check. The chassis tubes will be cut to their final length once everything has been checked and tested.

The rear axle is just sitting there for show at the moment. I’m hoping to get the new rear stub axles constructed this week so that we can do some billycart testing next weekend.

Front view.

Aug 02

Windows msc commands

Computer Management


Disk Manager


Local Users and Groups Manager


Scheduled Tasks


Services Management


Older posts «