Find a partner. Programming in a team is a whole lot more motivating and productive than solo. You're forced to work to produce code if the other guy needs to integrate with it. You'll also get someone to bounce ideas off this can inspire and motivate. Set milestones and reward yourselves when you reach them.
Go out and do stuff, like join clubs or get involved in local events. Some ideas:
1. Join a local amateur dramatics society. You don't have to act/sing/dance. You can work backstage on lights and sound (geeky stuff) or build sets. There are always more females than males at these things. The social side is huge.
2. Join a club to learn or enjoy one of your less geeky interests, like maybe dancing, playing music, photography, walking, etc.
3. Work in a bar at weekends. Girls you don't know will come up to you and talk to you - and order drinks.
4. Join a gym (you probably need to anyway) and look out for social activities.
5. Read the local papers for activities and events in the area.
Also: wash, shave, brush your teeth, cut your hair, wear clean clothes. Remove other useless blemishes such as iPhones.
Good luck.
This restaurant was advertising breakfast any time. So I ordered french toast in the renaissance. - Steven Wright, comedian