Sometimes the ghost in the machine just needs to be shown who's boss, either by crushing its hopes and aspirations by doing boring things like mining bitcoin, or by staring intently at the brain box when it misbehaves, wag your finger and shout "NO!, Work you piece of crap!"
Sometimes your haunted hardware will not take kindly to this, and choose to only play up when you have thought its fixed, Its foolish way of lashing out at its cruel hosts operator. This is when you step things up, put on your best menacing grin, begin whistling the most innocent tune you can and slowly, and carefully remove the side panels of the case, most will see this as a threat and stop there shenanigans,
Still some do continue, this is when you need to pull out the drastic methods, yank out the power and leave it a night to cool its head in timeout, blow out all the ectoplasm bound dust and dirt and turn it back on to see if its seen the error of its ways. Generally by this point they have settled down, or have become so angry that they broke there host. this is the way of knowing if you had a ghost worth keeping.