This solely depends on whether you plan on working online or offline...
I love Spain, Barcelona is one of my favorite cities. However, it's not cheap there. So unless you can make at least 1,000 euros/month stable, I wouldn't recommend it. I've been told that Portugal is not expensive in terms of food/basic needs. But I think rent is not that cheap there, maybe at least 400 euros/month, like anywhere in western EU. I live in Prague, and I think there are many opportunities for expats here. Expenses are not that high either. I think you can survive for $500/month.