Its unsafe. If you need power permanently you need to run to run a new box and receptacle off a pre-existing circuit. You might need to run a whole new circuit and add a new breaker in your electrical panel if what your using requires more juice than a pre-existing circuit can safely handle.
If you use an extension cord with a grounding plug, it’s all right, as long as you aren’t using it to run anything with a high current demand, like a table saw. Computer equipment won’t give you any problems.