Start off with about a 6" piece of General Purpose (Single Wall) Heat Shrink Tubing of a medium wall thickness like a 3:1 or 4:1 Polyolefin type for 10-12 gauge (AWG) wire
with a heat gun, heat up about 1" at one end (it should not completely close up)
insert the wand from the spray lube can & zip tie off
Insert cable end & housing into other end & zip tie off
Then just wrap a shop towel/rag around both connection areas that were zip tied because some sprayed fluid IS going to escape under the pressure. Also lay a towel or something over the area of your bike that make get "overspray" on it (or at least clean it off afterwards)
This will work on your clutch and throttle cables.
Give it a good "5 second shot" - let it seep, repeat as needed until you see it dripping out the bottom of the cable housing (where you also need to place a rag around the base to catch the dripping excess lube)
This actually works better than most of those lube blocks that are made for this purpose, because you will not have near as much excess lube spraying out all over everything else, instead of inside the cable housing where it belongs.
Also, it usually shouldn't be an issue but if you have a situation where your bike is exposed to "things that would cause the cable housing to gunk up" & get sticky from dirt, corrosion, ect.... with the cable completely removed you can put one end of the cable head (ferrule) in a drill & spin it up - the wound strands of the cable will literally force more fluid through & help clean & lube it even more thoroughly! start slow though, & if it sticks it will probably just make it fray/break sooner than later so just R&R it.
For most, not necessary though
I'm sure most of you guys already know this trick, but I've tried it with the usual piece of clear rubber hose or whatever, & this heat shrink tube really holds the fluid in MUCH Better!