If staying inside and feeling sorry for yourself isn't helping your mood, then try keeping yourself busy. Go and see the main tourist sites of wherever you are, have a coffee or go to a bar. Don't sit on your laptop worrying about what people are doing back home. Go outside and sunbathe on the beach, do whatever you feel like doing. Keep busy and you'll soon find that homesickness will be the last thing you're thinking about.