well, you can´t prevent the initial porn thoughts, they pop out of nowhere, however you can do something about it when you realise you´re having those thoughts: don´t feed them, don´t engage in them, just pay attention to the present moment and they will vanish out of thin air. as for eletronic devices, in the first 3/4 weeks you´re going through the compulsion stage (acting on a impulse), and it will be very hard to handle the urges if you´re sorrounded with the tools to relapse. it´s gonna be like an alcoholic living in a liquor store. so the safest way is to simply prevent yourself from being home alone. if you need to be home alone take all eletronic devices out of the house, no questions asked.