I just bought and received a guitar cable from Ebay. New.
Using an adapter, I connected it to my computer and to my guitar (well, it's an electric ukulele, but it's mechanically exactly the same as an electric guitar.)
I opened Garageband, clicked "new instrument", clicked "real instrument"...