By changing the locks and turning off your power, the landlord engaged in "self-help" which is blatantly illegal. This is such a basic concept that any even half-way sophisticated landlord knows not to do. As a result, I've never had a case where the landlord has done it. I'm fairly certain, though, that if you sued the landlord for this, you could get either your actual damages or a penalty of up to $100/day that your power stays off, etc. Please google "California Civil Code 789.3". I have linked it below and explicitly says that a landlord cannot interrupt utilities or change locks with the intent of forcing a tenant out.
The second issue is the 3-day notice. Because your landlord did not receive rent, he is entitled to give a 3-day notice to quit to the occupants of the rental unit. Since your friend moved out, you're the only occupant being subject to this 3-day notice. What the landlord should have done is file an eviction lawsuit against you if you didn't pay rent by the end of the 3 days. He should not have engaged in self-help.
If your landlord was to file suit to evict you, it seems to me that he would win. You do not appear to have a defense based on what you wrote that would allow you to stay in the rental property. What I would suggest is this: negotiate with your landlord.
Explain to him that he broke the law by engaging in self-help and that you can and will sue him for money for it. However, if your landlord was willing to give you an extension of time (let's say you need an extra week beyond the 3 days) to move out, you won't sue him and you can both part ways and go on with your lives.
Negotiations depend very much on the facts of each situation so you'll have to know what you can reasonably ask for. My point is that because the landlord engaged in illegal self-help, that gives you a chip with which you can bargain for more time to move out and avoid going through an actual eviction suit.
Hope that helps. I am not in southern California, otherwise I would be happy to help you with this.
The answer provided above is based upon California and/or New York law and is based solely upon the limited information provided by the poster. No attorney-client relationship is created. A future in-person consultation may reveal additional facts that may change the answer provided.