I believe I first read this from one of KM's posts, and it worked well for me.
1. Disconnect the cable ends.
2. Cut the corner of a Zip-Loc bag off and slide it over the upper end of the cable. Tape the bag to the cable so it is leakproof....
Yes, that works for clutch cables, throttle cables, brake cables, and choke cables...BUT... the speedometer cable should be greased, not oiled with cable lube or oil.
The other cables just move back and forth, but the speedo cable turns , and should be lubed with bearing grease instead.
First remove the cable from the bike. Then just pull the inner cable out of the housing..I forget which end. Be carefull to notice that there are some very tiny washers than fit on the cable..don't loose them. Spray a bunch of WD 40 down the housing to clean it out... then, go over to your neighbors house and holding each end in turn... spin the housing over your head so any excess oil gets flung out. (now you see why you do not want to do this near your house)
Coat the cable with grease. (I use marine grade bearing grease...) and slide the cable back in the housing, making sure any of those small washers are back in the right spot. Re-install the cable to the wheel , then to the speedo.
This is alot cheaper than buying a new one...but if that makes you happy...go ahead.